home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / INFO / DOSIMP10.ZIP / SIMPLY5.HYP < prev    next >
Text File  |  1991-08-12  |  109KB  |  1,995 lines

  1.                            The |TDOSSHELL|T Command
  2.  
  3. The first thing I have to say about the DOS Shell is that I'm sorry.  I
  4. really am.  I just can't do this.  I wanted to work with the Shell for
  5. a while and learn how to deal with it, so that I could do a good job of
  6. writing about it.  But I just can't do it.  I hate Shells.  I tried, I
  7. really did.  But I can't.  Forgive me?  I'll tell you everything I know
  8. about it, though.
  9.  
  10. First, what is the DOS Shell?  Well it's a menu-driven mouse-supporting
  11. interface that "protects" you from having to deal with DOS.  (Now you can
  12. see why I hate it, because I love DOS and don't want to be protected from
  13. it.)  It shows you a menu of things that you can do, and you use the ar-
  14. row keys or the mouse to choose the thing you want to do, and it does it
  15. for you.  You don't have to know any DOS commands or anything to be able
  16. to use it.  Of course you do have to know about DOS in order to be able
  17. to configure it to your personal taste, and to add your own menu choices
  18. to it and stuff.
  19.  
  20.                            <page down> for more
  21.                             DOSSHELL continued
  22. When you enter the |nDOSSHELL|n command, after a minute, you will see the
  23. Shell.  To get the menus, just hit the <Alt> key and the menu bar will
  24. light up, you just type the letter that stands for the menu you want to
  25. see.  Then you type the letter that's highlighted in the option you want
  26. to choose from that menu.  Or you can use the <Left> and <Right> arrows
  27. to move to another menu, or you can use the <Esc> key to get out of the
  28. menus altogether.  To get help, just hit the <F1> key.
  29.  
  30. The version 4 DOS Shell requires that you use the APPEND command so that
  31. the Shell will be able to find its companion files.  But the |nAPPEND|n com-
  32. mand is not a good thing to use.  Besides that, it's a TSR so it's really
  33. a waste of memory.  There's a way to get around the need for the |nAPPEND|n
  34. command though.  Just edit the |nDOSSHELL|n.BAT file, add the lines C: and |nCD|n
  35. C:\DOS at the beginning, and CD\ at the end.  This will change to the DOS
  36. directory before running the Shell, so that all the companion files will
  37. be in the current |ndirectory|n and the Shell will be able to find them even
  38. without the |nAPPEND|n command.
  39.  
  40.                            <page down> for more
  41.                             DOSSHELL continued
  42. Well one thing that causes a lot of trouble for DOS Shell users is that
  43. when you use <Shift-F9> or "Command Prompt" to get to a DOS prompt, that
  44. doesn't mean you've exited the Shell.  It just means you're shelling out
  45. to a secondary copy of COMMAND.COM.  If you turn off the computer at that
  46. point, the DOS Shell will leave a temporary file behind, with a name like
  47. 10370F37 or something like that.  In order to have the Shell delete its
  48. temp files, you have to really and truly exit the Shell via the Exit op-
  49. tion on the Files menu, or by using the <F3> key (more than once if nec-
  50. essary, depending on what part of the Shell you're in at the time).
  51.  
  52. If you want to be able to print files from within the DOS Shell, you have
  53. to first install the PRINT TSR from the command line.  (Not, and I repeat
  54. not, from within the Shell.  Exit the Shell completely first.)  Just type
  55. |nPRINT|n <Enter>, and it will ask you what port your printer is attached to.
  56. If it's on LPT1 then hit <Enter> again, and otherwise tell it the correct
  57. port and hit <Enter>.  When you go back into the Shell, your Print option
  58. on the Files menu will work.  If you really want to be able to print from
  59. within the Shell all the time, and you have the memory to spare, then you
  60.                            <page down> for more
  61.                             DOSSHELL continued
  62. can put |nPRINT|n /D:|nLPT1|n (or |nPRINT|n /D:|nCOM1|n if your printer is attached to
  63. that port instead) into your AUTOEXEC.BAT.  Then the print option in the
  64. Shell will be active at all times.  Your screen will start displaying a
  65. message about the print queue being empty every time you boot your compu-
  66. ter, but that's ok, that's what it's supposed to say because you haven't
  67. told it yet what file you want to print.
  68.  
  69. Well that's about all I know about the version 4 DOS Shell.  The one in
  70. version 5, on the other hand, has some extra features over the old one.
  71. Best of all, it's got a task switcher.
  72.  
  73. What's a task switcher?  Well, you know how if you're in the middle of
  74. one application and you need to get some information out of another?  You
  75. have to save whatever you're working on in the app you're in, and exit
  76. it, and start up the other app, get the info you wanted from it, exit
  77. that one, and start the first one back up, and find the point where you
  78. had left off.  Well, a task switcher allows you to have more than one app
  79. open at a time, and switch back and forth between them.  The ones that
  80.                            <page down> for more
  81.                             DOSSHELL continued
  82. are in the background aren't actually running.  They're just sort of in
  83. limbo, so it's not like running a multitasker.  But it's a lot easier
  84. than exiting and starting and exiting a bunch of applications.
  85.  
  86. When you swap from one application to another, everything that's in RAM
  87. is copied to your hard drive for storage, so that when you switch back to
  88. that app, whatever is now in memory is copied to a different swap file
  89. and that first swap file on the hard drive is copied back into |nRAM|n and
  90. you're right where you left off in that first app before you swapped to
  91. the second one, and the second one is sitting on the hard drive ready for
  92. you to swap back into it.  (These swap files are huge and they are also
  93. Hidden files, so if you reboot from inside an app, they'll stay on the
  94. hard drive but you won't notice until your hard drive space disappears.)
  95.  
  96. All you have to do to be able to do task switching with version 5.0's
  97. Shell, is to pull down the Options menu and put your cursor on Enable
  98. Task Swapper and hit the <Enter> key.  That should put a little diamond
  99. on that line right next to the Enable Task Swapper option, and now you
  100.                            <page down> for more
  101.                             DOSSHELL continued
  102. can start one program, then hit <Ctrl-Esc> to get back to the DOS Shell,
  103. and start another program, etc.
  104.  
  105. The task swapper uses whatever directory is referenced by the TEMP vari-
  106. able in your environment, so if you have enough memory to make a really
  107. big (at least one meg) RAMdisk, and supposing that your |nRAMdisk|n's drive
  108. letter is E:, then put |nSET|n TEMP=E:\ into your AUTOEXEC.BAT, then the task
  109. swapper will put all its swap files there.  (Until the |nRAMdisk|n fills up,
  110. that is.  If you have a whole bunch of applications active at once, then
  111. the overflow will go into your C:\DOS |ndirectory|n.)  Two benefits of this.
  112.  
  113. First, a |nRAMdisk|n is about a million times faster than a hard drive.  And
  114. second, the |nDOSSHELL|n and the task swapper are all the time creating these
  115. little temporary files and leaving them lay around in whatever |ndirectory|n
  116. is listed in your TEMP variable.  Those files automatically get deleted
  117. whenever you exit the application involved or the |nDOSSHELL|n itself.  But
  118. sometimes your machine locks up and you have to reboot it, so those temp
  119. files don't get deleted.  Well if they're on the |nRAMdisk|n, then the temp
  120.                            <page down> for more
  121.                             DOSSHELL continued
  122. files don't just hang around waiting for you to find them and start won-
  123. dering where they came from, because everything on a RAMdisk is erased
  124. when you reboot.  So those files are gone, out of your way.
  125.  
  126. The |nDOSSHELL|n is a really good candidate as a program that can be run from
  127. a |nRAMdisk|n to speed it up.  To do so, make sure the |nRAMdisk|n's root dir-
  128. ectory is the very first directory listed on your PATH, and then put the
  129. line |nCOPY|n C:\DOS\DOSS*.* E:\ into your AUTOEXEC.BAT file (that's again
  130. assuming your |nRAMdisk|n is drive E:), and that way whenever you issue the
  131. |nDOSSHELL|n command, DOS will run the copy that's on the fast |nRAMdisk|n in-
  132. stead of the copy of the program that's on the slow hard disk.  But, one
  133. thing you want to remember if you do that, is if you make any changes to
  134. the |nDOSSHELL|n's configuration, you will need to COPY the |nDOSSHELL|n.INI file
  135. back to your C:\DOS |ndirectory|n before you turn off the computer.  Or else
  136. the changes you made will be gone the next time you boot up the computer.
  137.  
  138. If you have an EGA monitor you will want to install EGA.|nSYS|n, which is a
  139. device driver that you use by putting a DEVIC|1E or DEVICEHIGH command into
  140.                            <page down> for more
  141.                             DOSSHELL continued
  142. your CONFIG.SYS file.  Otherwise, every time you switch between one ap-
  143. plication and another, it's likely that the screen will be all messed up.
  144.  
  145. Make absolutely sure that the Select Across Directories choice in the Op-
  146. tions menu, is not enabled.  Use that option only when you need to, and
  147. remember to always turn it back off as soon as you're done with whatever
  148. you needed it for!  Otherwise, whatever filename the cursor was sitting
  149. on when you first entered the Shell, will be one of the ones deleted, or
  150. copied, or whatever, when you do anything that can affect more than one
  151. file at a time.  Really terrible things can happen to your files if you
  152. leave Select Across Directories enabled!
  153.  
  154. With DOS 5.0's Shell, it's really easy to customize the colors exactly to
  155. your own taste.  Just use the EDIT command to edit the |nDOSSHELL|n.INI file,
  156. go near the end where you can see a bunch of colors written, pick out one
  157. of the combinations that you're sure you will never want to use, such as
  158. hot pink, and change all its colors, save the file, and the next time you
  159. go into |nDOSSHELL|n choose the combination you edited, and it'll be the one
  160.                            <page down> for more
  161.                             DOSSHELL continued
  162. you created instead of the one that used to exist under that name.
  163.  
  164. You want to be careful how you change it though.  I mean if you want to
  165. change blue to green, then change all of the blues to green, and don't
  166. change anything else to green.  The same for any other color.  Because
  167. if you accidentally change, say, the foreground of the menus to red and
  168. change the background of the menus to red as well, you won't be able to
  169. read a word of the menus.
  170.  
  171. Speaking of colors, if you use ANSI.SYS and ESC sequences to change the
  172. colors of your DOS screen, the Shell will probably mess them up when you
  173. exit back to DOS.  If the color choice includes a colored background your
  174. screen will be black, and just the prompt itself will be your chosen col-
  175. ors when you exit the Shell.  To fix that problem up, you just need the
  176. CLS command.  So if you use a DOSKEY macro like DS=DOSSHELL $T |nCLS|n then
  177. your screen will get cleared for you, to the proper colors, each time you
  178. exit the Shell, even if you just shell out using "Command |nPrompt|n" or the
  179. <Shift-F9> option.  I'm not sure why it works in those cases but it does.
  180.                            <page down> for more
  181.                             DOSSHELL continued
  182. If you run a program from within the Shell, that requires that you load
  183. some TSR, then run the program, then unload the |nTSR|n, then when you exit
  184. that program you'll get a screen that says something about "pop-up sup-
  185. port" and tells you to press <Ctrl-C> to continue.  That's ok, because
  186. it's supposed to do that, to make sure that |nTSR|n that got loaded, gets
  187. properly removed from memory before going back to the Shell.
  188.  
  189. You mustn't ever run commands such as CHKDSK with the /F switch, or DEL
  190. or ERASE or UNDELETE or such things that affect the information on your
  191. disk while you have another program running in the task switcher!  Be-
  192. cause you don't really have any way of knowing for sure what disk files
  193. the other program has open at the time.  Really awful things can happen
  194. if you do those commands while another program is running.
  195.  
  196. Even |nCHKDSK|n without the /F switch will do funny things if run from in-
  197. side the |nDOSSHELL|n.  Because there are temp files open while the Shell is
  198. in use, and |nCHKDSK|n will think that those are lost clusters.  If you exit
  199. the Shell with <F3>, then run |nCHKDSK|n again, it won't find any lost clus-
  200.                            <page down> for more
  201.                             DOSSHELL continued
  202. ters after all.  What a relief, right?
  203.  
  204. You can make the Shell do anything you want it to do by adding a new item
  205. to the menu.  To do that, you choose "New" from the Files menu while your
  206. cursor is on the Main Group.  On the Properties window of the screen you
  207. get when you do that, there's a space where you should enter the commands
  208. you want the Shell to perform whenever you select this new menu item.  In
  209. that space, you can enter just about any commands you want, including the
  210. use of environment variables, just like you were writing a batch file ex-
  211. cept you can't use the GOTO and SHIFT commands, and you separate commands
  212. with " ; " (a semicolon surrounded by spaces) instead of a touch of the
  213. <Enter> key.  And the @ symbol doesn't work in these "pseudo-batch files"
  214. but that's ok because ECHO is automatically off.  Be sure to notice the
  215. Pause option on that Properties screen.  If there's an X next to it (the
  216. |sdefault|s) then when your "pseudo batch" commands are done, you'll get a
  217. "Press any key" message before you go back to the Shell.  That's for in
  218. case your command displays something on the screen at the end, that you
  219. need to see.  If your command doesn't do that, and you don't want it to
  220. pause, hit the <Space> bar on that Pause option to remove the X.
  221.                              The |TMODE|T Command
  222.  
  223. This command has about a million uses.  This is going to be a long sec-
  224. tion.  I think that the most common use for it is to change the video
  225. mode after some program (usually a game) has messed it up.  If you exit
  226. a program and your screen has letters that are twice their normal size,
  227. or your screen is so messed up that you can't even tell you have a prompt
  228. or cursor, try typing |nMODE|n CO80 (that's C-Oh-Eight-Zero) and hit <Enter>.
  229. There, is that better?  That stands for COlor and eighty columns, so if
  230. you don't have a color monitor, use BW80 instead, because that stands for
  231. Black and White and eighty columns.
  232.  
  233. If you have trouble seeing the little letters on the screen, try |nMODE|n
  234. CO40 and see if that helps.  Of course most applications that you run
  235. are going to set it back to CO80, so you'll have to keep setting it back
  236. to CO40 every time you exit back to DOS.  But a batch file can make that
  237. easy on you.
  238.  
  239. If you have DOS version 4 or 5, you can use the |nMODE|n command to change
  240.                            <page down> for more
  241.                               MODE continued
  242. your keyboard repeat rate.  You know when you hold a key down it is sup-
  243. posed to zoom across the screen typing that same letter or function over
  244. and over again?  Well it doesn't "zoom" very well until you do something
  245. to raise the repeat rate.  The version 4 |nMODE|n command can do that.  |nMODE|n
  246. CON: DELAY=## RATE=## is what the command would look like to perform that
  247. function, and you just need to figure out what you want to use in place
  248. of ##.  The DELAY= number means how long you want to have to hold down
  249. the key before it starts repeating.  You can use the numbers 1 through
  250. 4, and they represent quarter-seconds.  If you use DELAY=1, then if your
  251. finger accidentally holds the key down for one quarter of a second, what-
  252. ever letter you're holding down will start zooming across the screen.  If
  253. you use DELAY=4 you'll have to hold the key down for a full second before
  254. it will start repeating.  The RATE= parameter specifies approximately how
  255. many times per second the key should repeat.  You can use any number from
  256. 1 to 32.  I use |nMODE|n CON: DELAY=2 RATE=32 in my AUTOEXEC.BAT file.  And
  257. while this command is not a TSR, it does actually change one of the |sCPU|s's
  258. registers, so this change you make with the |nMODE|n command will be effec-
  259. tive in most of your applications, not just at the DOS command line.  Of
  260.                            <page down> for more
  261.                               MODE continued
  262. course some applications might reset it, so you would need to reset it
  263. again.  A batch file will make that easy for you.  If you find an applic-
  264. ation that resets the keyboard repeat rate (also called typematic rate),
  265. then start that app from a |nbatch file|n, and have the |nMODE|n CON: command as
  266. the last line of that |nbatch file|n, so that your repeat rate always gets
  267. reset between the time you exit the app and the time you see your prompt.
  268. Of course it's possible that this command won't affect your |nkeyboard|n at
  269. all.  It works on most systems, but not all.  Can't hurt to try, though.
  270. The default values are DELAY=2 and RATE=20.  But if you change one, you
  271. have to specify both in the command.
  272.  
  273. You can use the |nMODE|n command to tell your printer how many characters per
  274. line and how many lines per inch to print.  Of course most applications
  275. that are designed to do any printing will reset the printer, but what you
  276. set with the |nMODE|n command will work when you're in DOS, with the PRINT,
  277. |nCOPY|n FILE PRN, or |nTYPE|n FILE > PRN commands.  |nMODE|n LPT#:N,M,P is the for-
  278. mat for this function of the |nMODE|n command.  LPT# means which port your
  279. printer is attached to.  N means how many characters per line, 80 or 132.
  280.                            <page down> for more
  281.                               MODE continued
  282. M means how many lines per inch, 6 or 8.  The P you will probably want to
  283. leave out.  It means that if the printer tells the CPU it's busy, the |nCPU|n
  284. will keep trying to send more data anyway.  This is called continuous re-
  285. try.  If you do use the P and your system seems to hang up, you can break
  286. out of it with <Ctrl-C> or <Ctrl-Break>.  (The system will not respond
  287. right away, though, it will take maybe half a minute.)  This form of the
  288. |nMODE|n command should only be used with Epson-compatible printers.  If you
  289. have DOS version 4 or later this form of the command changed also.  |nMODE|n
  290. LPT#: COLS=N LINES=M RETRY=P is what it's like now.  The old form will
  291. still work just fine, but if this form is easier for you, then use it in-
  292. stead.
  293.  
  294. If you have DOS version 4.0 or later, and you have ANSI.SYS installed in
  295. your CONFIG.SYS file, and you have an EGA or VGA display, then you might
  296. use the |nMODE|n command to set your screen to 43 or 50 lines instead of just
  297. 25.  |nMODE|n CON: COLS=M LINES=N would do it, where M can be 40 or 80, and N
  298. can be 25 or 43, or if you have a VGA, then N could also be 50.  And if
  299. you install |nANSI.SYS|n with an /L switch, it will even try to force your
  300.                            <page down> for more
  301.                               MODE continued
  302. applications to display in this higher number of lines per screen, and
  303. leave the display in this mode when you exit back to DOS, although it
  304. won't work for all applications.
  305.  
  306. You can also use |nMODE|n to set the parameters for your COM1 or other serial
  307. port.  Here's an example of the most common setting for this function of
  308. the |nMODE|n command:  |nMODE|n |nCOM1|n:2400,N,8,1,P  where |nCOM1|n refers to the comm
  309. port you're trying to set |nparameters|n for.  2400 is the baud rate, N means
  310. no parity, 8 means 8 data bits per byte, 1 means 1 stop bit, and P means
  311. continuous retry for when you're using a serial printer.  The choices for
  312. port number are 1 or 2 for DOS 3.2 or earlier, or 1 through 4 for DOS 3.3
  313. or later.  Baud can be 110, 150, 300, 600, 1200, 2400, 4800, or 9600, de-
  314. pending on the rate supported by your modem and the modem you'll be call-
  315. ing, and the conditions of the phone lines from here to there.  DOS ver-
  316. sion 3.3 adds a rate of 19200 to those choices.  Parity can be None, Odd,
  317. or Even.  Data bits can be 7 or 8, stop bits can be 1 or 2, and the P can
  318. be there or not.  For DOS version 4, of course this form of the |nMODE|n com-
  319. mand changed too.  |nMODE|n COM#: BAUD=B PARITY=Y DATA=D STOP=S RETRY=P.  Now
  320.                            <page down> for more
  321.                               MODE continued
  322. you're probably thinking that this form of the command is only for modems
  323. but that's not the case!  In fact, it is rarely used for modems, because
  324. most people use specialized communications software to work with the mo-
  325. dem, and it sets the parameters for them.  This form of the |nMODE|n command
  326. is more often used for serial printers and mice and such things.
  327.  
  328. If you have a serial printer instead of a parallel printer, you need to
  329. use the |nMODE|n command to tell DOS to send whatever data it would normally
  330. send to LPT1, to your serial port instead.  This command's syntax is a
  331. lot easier than some of the other forms of the |nMODE|n command.  It's like
  332. this:  |nMODE|n |nLPT1|n:=COM#: where # is the number of the serial port your
  333. printer is connected to.  But first you have to use the other |nMODE|n com-
  334. mand above to tell your serial port what |nparameters|n to use.  Yes, that's
  335. right, the difficult one with the baud rate, parity, stopbits, and all
  336. that.  But your printer manual should tell you exactly which |nparameters|n
  337. to use so you shouldn't have to figure it out by yourself.  If you want
  338. to put the printer output back to |nLPT1|n, then |nMODE|n |nLPT1|n: will do that.
  339.  
  340.                            <page down> for more
  341.                               MODE continued
  342. While most functions of the |nMODE|n command do not involve loading a TSR,
  343. some do.  If you see the message "Resident portion of |nMODE|n loaded", it
  344. means that you did use one of the functions of the |nMODE|n command that
  345. loads |nMODE|n as a |nTSR|n.
  346.  
  347.  
  348.  
  349.  
  350.  
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360.  
  361.                              The |TJOIN|T Command
  362.  
  363. This is not exactly the safest of commands.  If you ever have any desire
  364. to try it, don't, unless you have a |ncurrent|n backup of all the disks that
  365. will be involved.  This command didn't exist until DOS version 3.1.
  366.  
  367. This command is used to join one disk drive to an empty directory of some
  368. other drive, so that it will seem like the files on the drive are instead
  369. files in the empty |ndirectory|n on the other drive.
  370.  
  371. The syntax is like this:
  372.           |nJOIN|n D: D:\DIR
  373. Suppose you want the files on drive A: to appear that they are files in
  374. the \OTHER |ndirectory|n on drive C:.  You would first make sure you have an
  375. empty |ndirectory|n (with no files or other subdirectories in it) named OTHER
  376. branching from the root |ndirectory|n on drive C: (if there is no such direc-
  377. tory, |nJOIN|n will create it), then issue the |nJOIN|n A: C:\OTHER command.  Now
  378. when you do a DIR of C:\OTHER, the access light on drive A: will light up
  379. for a minute, and a |ndirectory|n listing of the drive A: files will appear.
  380.                            <page down> for more
  381.                               JOIN continued
  382. Now if you issued the command |nDIR|n A:, you'd get an error message, "In-
  383. valid drive specification" because drive A: doesn't exist anymore.
  384.  
  385. To show what drives might be under the effect of a |nJOIN|n command, just
  386. enter |nJOIN|n all by itself, with no parameters, and it will say something
  387. like A: => C:\OTHER and if you want to unjoin them, just do |nJOIN|n A: /D.
  388. That puts everything on drive A: and C:\OTHER back to normal.
  389.  
  390. APPEND, ASSIGN, BACKUP, CHDIR, CHKDSK, DEL, DISKCOMP, DISKCOPY, ERASE,
  391. FASTOPEN, FDISK, FORMAT, LABEL, MIRROR, MKDIR, PATH, PRINT, RECOVER,
  392. RESTORE, RMDIR, SUBST, and SYS are all commands that shouldn't be used
  393. with a |nJOIN|n in effect.
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.                               The |TMEM|T Command
  402.  
  403. Don't you hate the way you have to use the CHKDSK command and wait for it
  404. to finish looking at your disk, in order to find out how much free memory
  405. you have at the moment?  Well if you have DOS version 4 or later, there's
  406. no need to use |nCHKDSK|n for that purpose anymore!  That's what the |nMEM|n com-
  407. mand is for.
  408.  
  409. Not only does it tell you how much |nmemory|n is currently free, it can also
  410. tell you a whole bunch of other information if you ask it to real nicely.
  411.  
  412. You can use |nMEM|n all by itself or with the /P, /D, or /C switches, and |nMEM|n
  413. will tell you a different amount of information depending on which switch
  414. you use.  The /C switch is the one you want to use if you have DOS 5 and
  415. you want to see what's going on in the Upper |nMemory|n Blocks.
  416.  
  417. If you're using the HIMEM.SYS device driver and the |nMEM|n command tells you
  418. that your available extended |nmemory|n is zero, don't panic.  Look where it
  419. says how much available XMS |nmemory|n you have.  That's where your |nextended|n
  420.                            <page down> for more
  421.                                MEM continued
  422. memory went.  XMS |nmemory|n is just extended |nmemory|n that's being managed by
  423. an |neXtended|n |nMemory|n Specification 2.0 device driver.  If you have an ap-
  424. plication that uses |nextended|n |nmemory|n but cannot use |nXMS|n 2.0 |nmemory|n, then
  425. you want to tell HIMEM.SYS not to convert all the |nextended|n to |nXMS|n.  To do
  426. so, you use the parameter /INT15=### where ### is the number of Kilo|sbytes|s
  427. you want to leave as plain old |nextended|n |nmemory|n instead of |nXMS|n, plus 64K.
  428. For example, if you want to keep 256K of |nextended|n |nmemory|n, then you would
  429. use this command in your CONFIG.SYS file:
  430.           DEVICE=C:\DOS\HIMEM.|nSYS|n /INT15=320
  431. because 256+64=320, so that will leave you with 256K of |nextended|n |nmemory|n,
  432. and the rest will still be converted to |nXMS|n |nmemory|n.
  433.  
  434. If the |nMEM|n command doesn't report anything about EMS |nmemory|n, then that
  435. means that either you don't have any expanded |nmemory|n, or else that your
  436. |nexpanded|n |nmemory|n is not LIM 4.0 compatible.  |nMEM|n won't say anything about
  437. |nextended|n |nmemory|n either, if you don't have any of that.
  438.  
  439.  
  440.  
  441.                             The |TMIRROR|T Command
  442.  
  443. This command is new to DOS version 5.0, but many of us have been using it
  444. for quite some time.  Microsoft licensed it from Central Point Software,
  445. the makers of PC Tools.  It performs two great functions.  First, every
  446. time you reboot the computer it stores a copy of your FAT, |nboot|n record,
  447. and root directory in a nice safe place, for in case your originals get
  448. trashed, then you can use the UNFORMAT command to put them back together
  449. again.  The files that |nMIRROR|n makes are called MIRORSAV.FIL, which has
  450. its Read-only, System, and Hidden attributes turned on, and |nMIRROR|n.FIL
  451. and |nMIRROR|n.BAK which have their Read-only |nattributes|n turned on.  These
  452. files are going to go into your |nroot|n |ndirectory|n whether you like it or
  453. not.  There's no way you can put them somewhere else because if you do,
  454. the program will just create new ones in the |nroot|n |ndirectory|n the next time
  455. you |nreboot|n.  But you don't have to leave them visible in your |ndirectory|n
  456. listing.  The program recreates them each time, so you can't just turn on
  457. their Hidden |nattributes|n and leave it at that.  The next time you boot up,
  458. they will be recreated without any Hidden |nattributes|n.  But you can put
  459. the command |nATTRIB|n +H |nMIRROR|n.* into your AUTOEXEC.BAT file right after
  460.                            <page down> for more
  461.                              MIRROR continued
  462. the |nMIRROR|n command, and you'll never see those files in a DIR listing
  463. again unless you use the /A switch with the |nDIR|n command.
  464.  
  465. Also, if you use the /T switch, |nMIRROR|n will install a TSR called Delete
  466. Tracking.  This one watches everything you do, and whenever you (or any
  467. program) try to delete a file, it keeps a record of it and stores that
  468. record in a file named PCTRACKR.|nDEL|n in your root directory, so that if
  469. you should end up wanting to undelete the file, all the information the
  470. UNDELETE command will need will be right there in that file, so that you
  471. have a 100% chance of getting all of the file back unless you (or some
  472. program) have written something to the disk in the spot where the file
  473. was, between the time you deleted the file and the time you used the UN-
  474. DELETE command on it.  This PCTRACKR.|nDEL|n file has its System attribute
  475. turned on, so you won't be bothered with looking at it in your |nDIR|n list-
  476. ings all the time.  It's also pretty difficult to delete this file.  Be-
  477. cause it keeps a record of every file you delete, if you delete it, it
  478. reconstructs itself immediately in order to store a record of the fact
  479. that you just deleted it.  The only way to get rid of it is to reboot the
  480.                            <page down> for more
  481.                              MIRROR continued
  482. computer without the /T switch in the |nMIRROR|n command in your AUTOEXEC.BAT
  483. file, and then delete it.
  484.  
  485. One thing you do not want to do if you ever do the command FORMAT C:, or
  486. RECOVER C:, or DEL |n*.*|n, or ERASE |n*.*|n in the root directory, is reboot the
  487. computer to see if the problem clears up.  Sometimes rebooting can cure a
  488. multitude of ills in a computer, but not in this case.  And because MIR-
  489. ROR stores the two most recent mirror images of your FAT and |nroot|n direc-
  490. tory, if you |nreboot|n once after you trash your drive, then your first copy
  491. of the mirror image is bad, and if you |nreboot|n again, now both your copies
  492. are bad and it's like as if you never used |nMIRROR|n in the first place.  In
  493. that case, the UNFORMAT command will have a terrible time trying to help
  494. you.  So don't do that.  If rebooting once doesn't fix it, then rebooting
  495. again won't either, and just destroys most of your chances for recovery.
  496.  
  497. The syntax for this command is like this:
  498.           |nMIRROR|n D: D: D: /1 /TD-## /TD-## /TD-##
  499. where the D:s are the drive letters for which you want to save the |nFAT|n
  500.                            <page down> for more
  501.                              MIRROR continued
  502. and root directory information, /1 means you only want to save the most
  503. recent copy instead of the two most recent copies, the Ds with the /T
  504. switches tell what drives you want delete tracking installed for (that's
  505. right, it's one of the rare times you want to refer to a drive letter
  506. without including a colon), and the ##s stand for how many entries you
  507. want to save for each drive.  For example, here's the command I have in
  508. my AUTOEXEC.BAT file:
  509.           |nMIRROR|n C: /TC-50
  510. which means to save the FAT and |ndirectory|n information for the C: drive,
  511. and install delete tracking to monitor deletions on the C: drive and save
  512. information on only the 50 most recent files that I've deleted.
  513.           |nMIRROR|n C: D: /TC-100 /TD-50 /TE-25
  514. would save the |nFAT|n and |ndirectory|n information for drives C: and D:, and
  515. load delete tracking to save information on the most recent 100 deletions
  516. on drive C:, the most recent 50 deletions on drive D:, and the 25 most
  517. recent deletions on drive E:.
  518.  
  519. The value you use for the -## parameter can be from 1 to 999, and the
  520.                            <page down> for more
  521.                              MIRROR continued
  522. default depends on the size of the disk in question.  If you have a hard
  523. drive larger than 32M, the |ndefault|n will be a 55K file containing records
  524. of the 303 most recent files you deleted.
  525.  
  526. You can unload the deletion tracking TSR by using the /U switch, as in
  527. |nMIRROR|n /U, but it only works if you haven't loaded any other TSRs since
  528. the time you loaded |nMIRROR|n, or if you unload the later TSRs first.
  529.  
  530. Of course, for the |nMIRROR|n command to work its magic, it has to be run
  531. every day, and that means putting the command in your AUTOEXEC.BAT file.
  532.  
  533. The Hidden file that |nMIRROR|n saves the data in, MIRORSAV.FIL, gets stored
  534. in the very last cluster on your hard drive, and if that spot on your
  535. disk is bad, |nMIRROR|n will take a long time to run each time.  So if you
  536. find that it's taking a long time, you will want to run a surface scan
  537. utility which will mark out bad clusters in the FAT, as if they were al-
  538. ready in use, so that DOS won't put any files in that spot.  Then the
  539. MIRORSAV.FIL will go in the next-to-last cluster on the disk instead, and
  540.                            <page down> for more
  541.                              MIRROR continued
  542. won't take so long to run, and will be a lot more reliable that way any-
  543. how.
  544.  
  545. One more thing that the |nMIRROR|n command can do is to save a copy of your
  546. hard drive's partition table to a floppy disk.  To do that, just enter
  547. the command |nMIRROR|n /PARTN with a disk in drive A:.  This will allow you
  548. to recover from an "Invalid drive specification" error message, if you
  549. ever receive such a thing in reference to your hard drive.  You only need
  550. to do this command one time in your life, unless you repartition your
  551. drive (with the FDISK command, most likely), but make sure you don't lose
  552. the |nfloppy|n that you saved that information to.  The file |nMIRROR|n /PARTN
  553. will create on that |nfloppy|n disk will be called PARTNSAV.FIL.
  554.  
  555.  
  556.  
  557.  
  558.  
  559.  
  560.  
  561.                            The |TUNFORMAT|T Command
  562.  
  563. This command is new to DOS version 5.0, but it's been around for a while.
  564. Microsoft licensed it from Central Point Software, the publishers of PC
  565. Tools, where its name was REBUILD.  It does just what its name implies.
  566.  
  567. In order for the |nUNFORMAT|n command to work, the disk it's being used on
  568. needs to have been formatted by the DOS version 5.0 FORMAT command, and
  569. without the /U switch.  Because this new safe |nFORMAT|n command runs MIRROR
  570. on the disk before it formats, to save a copy of the root directory and
  571. FAT in the |nMIRROR|n.FIL file.  (You won't need to have the |nMIRROR|n.COM file
  572. available though, because the applicable parts of MIRROR's code are in-
  573. side the |nFORMAT|n.COM file.)  You won't be able to see that |nMIRROR|n.FIL file
  574. on the disk, but unless you used the /U switch with the |nFORMAT|n command,
  575. and if there was enough blank space on the disk to fit the file, then it
  576. will be there.  (If there isn't enough room for this file, |nFORMAT|n will
  577. tell you, so it won't just pretend like it's working and then surprise
  578. you later.)  And the |nUNFORMAT|n command will be able to use that little
  579. file to put the disk back to exactly the way it was before you acciden-
  580.                            <page down> for more
  581.                             UNFORMAT continued
  582. tally formatted it.  Even if you did use the /U switch with the FORMAT
  583. command, if you have used the MIRROR command on that disk very recently,
  584. there's a good chance that the |nUNFORMAT|n command will be able to help you.
  585.  
  586. The |nUNFORMAT|n command can also undo the horrors caused by the RECOVER com-
  587. mand when it's been used on a whole disk or directory instead of only on
  588. one file at a time like the poor misunderstood |nRECOVER|n command is meant
  589. to be used.  Also, |nUNFORMAT|n can undo a |nDEL|n \*.* which means deletion of
  590. all the files in the root |ndirectory|n.  And finally, if you have ever used
  591. the |nMIRROR|n /PARTN command and still have the floppy disk that information
  592. was saved to, then |nUNFORMAT|n can restore the partition table on your hard
  593. drive, which is what needs to be done if you receive the message "Invalid
  594. drive specification".
  595.  
  596. Just be careful with the |nUNFORMAT|n command!  Don't go using it at the drop
  597. of a hat.  It is there for the purpose of recovering from a major disas-
  598. ter, not just for playing around with.  It doesn't always work perfectly,
  599. so if you use it on a small mistake you could end up in worse shape than
  600.                            <page down> for more
  601.                             UNFORMAT continued
  602. you already were in.  However, if you make a huge mistake, the |nUNFORMAT|n
  603. command will leave you better off than you were even if it isn't able to
  604. completely recover everything.
  605.  
  606. And don't dilly-dally around, between the time you make the horrible mis-
  607. take and the time you get busy and decide to use |nUNFORMAT|n.  If it's going
  608. to be done, it needs to be done right away.  Anything you do between the
  609. mistake and the |nUNFORMAT|n could overwrite the data that you're hoping to
  610. recover.  And data that has had more data written on top of it can never
  611. be recovered.  Don't forget that an awful lot of DOS operations, like any
  612. use of the || symbol or the DOSSHELL for example, writes temporary files
  613. to the disk that you might not be aware of.  Just because you have not
  614. personally written anything to the disk since the mistake, doesn't mean
  615. that DOS hasn't done so.  The longer you wait before using |nUNFORMAT|n, the
  616. greater the chance that the data will be overwritten before you can re-
  617. cover it.
  618.  
  619. Here's the syntax for this command:
  620.                            <page down> for more
  621.                             UNFORMAT continued
  622.           |nUNFORMAT|n D: /J /L /P /PARTN /TEST
  623. where D: is, of course, the drive which holds the disk you want to fix.
  624.  
  625. The /J switch just tells |nUNFORMAT|n to check to see whether there are any
  626. |nMIRROR|n.FIL and |nMIRROR|n.BAK files on the disk, and that they don't disa-
  627. gree with the system information.  You don't use any other switches along
  628. with this one!  When it's done, then you redo the |nUNFORMAT|n command with
  629. some other switches instead of this one.  The |nUNFORMAT|n /J command doesn't
  630. fix anything, or write anything to the disk.
  631.  
  632. The /L switch does not use the MIRROR files to help rebuild the drive in-
  633. formation.  It just does its best with what's left of the directory.
  634.  
  635. The /P switch makes |nUNFORMAT|n send all the data that would normally go to
  636. the screen, to the LPT1 printer port instead.  You don't need this at all
  637. if you have |nMIRROR|n files on the disk; only if you're using the /L switch.
  638.  
  639. The /PARTN switch is what makes |nUNFORMAT|n restore the partition table that
  640.                            <page down> for more
  641.                             UNFORMAT continued
  642. you had saved to a floppy disk ages ago with the |nMIRROR|n /PARTN command.
  643. You don't use any other switches along with this switch except maybe the
  644. /L switch which, when used with /PARTN, displays the partition table that
  645. it's restoring.  When |nUNFORMAT|n /PARTN is done, you will have to reboot
  646. from a |nfloppy|n disk and then use |nUNFORMAT|n to restore your directory and
  647. FAT.
  648.  
  649. The /TEST switch causes the |nUNFORMAT|n command to just pretend like it's
  650. recovering your disk, and it just shows you what it would be doing if you
  651. had not used this switch, so that you can decide whether unformatting is
  652. a good idea or not.  The |nUNFORMAT|n /TEST command does not change anything
  653. on the disk.  This is only relevant if you haven't been using the MIRROR
  654. command, or if you rebooted twice since the damage occurred, or if you
  655. rebooted once and ran the FORMAT command once, so that both of your MIR-
  656. ROR files are trash as well.
  657.  
  658. As long as a disk was not formatted with the /U switch, then |nUNFORMAT|n can
  659. put it back to the way it was just before it was formatted.  If the /U
  660.                            <page down> for more
  661.                             UNFORMAT continued
  662. switch was used with the FORMAT command, but if MIRROR had also been used
  663. on that disk before, then |nUNFORMAT|n still has a chance, though not a great
  664. one.  And if it does anything in this case, it'll be putting things back
  665. to the way they were at the time you last used the |nMIRROR|n command, so any
  666. new files you have created since then will be lost, and any files you've
  667. edited since then may be lost.
  668.  
  669. If you delete all the files in your root directory, don't use |nUNFORMAT|n to
  670. get them back unless you already tried UNDELETE and that didn't work.
  671.  
  672. If you use the |nUNFORMAT|n command without the /L switch, the |nMIRROR|n file
  673. will be used to help reconstruct the data.  First |nUNFORMAT|n will show you
  674. the date and time of the two |nMIRROR|n files (if the /1 switch was used with
  675. the |nMIRROR|n command, or if |nMIRROR|n has only been used once on that disk,
  676. there will only be one file from which to choose) and ask if you want to
  677. use the Latest one or the Previous one.  If you have |sreboot|sed the compu-
  678. ter with the |nMIRROR|n command in your AUTOEXEC.BAT file, or if you have
  679. formatted a corrupted disk, or in any way used the |nMIRROR|n command since
  680.                            <page down> for more
  681.                             UNFORMAT continued
  682. the disaster happened, say P.  Otherwise, say L.  If it's on a floppy,
  683. it's a really good idea to make two |sDISKCOPY|ss of the disk and try one
  684. method on each of them; the Latest MIRROR file, the Previous |nMIRROR|n file,
  685. and the |nUNFORMAT|n /L method.  That way you have the greatest chance of re-
  686. covering the data, even if you make the wrong decision as to which method
  687. to use, because you have chosen all methods.  It's too bad you can't use
  688. |nDISKCOPY|n with a hard disk so that you could do the same thing.
  689.  
  690. If the disaster from which you want to recover was caused by something
  691. other than DOS version 5's safe FORMAT command, and you've never used the
  692. |nMIRROR|n command on that disk, or if the |nMIRROR|n file on the disk is very
  693. old, or if the |nMIRROR|n file was created or updated after the disaster hap-
  694. pened, then you'll need to try the |nUNFORMAT|n /L command.  This method will
  695. try to recover whatever it can from the directory entries on the disk.
  696. You will definitely want to only use this command on a |nDISKCOPY|n of the
  697. original disaster-disk.  It may or may not help.  If you do it on a copy
  698. of the disk, then if it doesn't work you still have the original, and
  699. maybe some utility package such as the Norton Utilities might be able to
  700.                            <page down> for more
  701.                             UNFORMAT continued
  702. do a better job of recovery.  But if you try |nUNFORMAT|n on the only copy of
  703. the disaster-disk, and it doesn't work, then it's too late for Norton to
  704. be able to help.
  705.  
  706. If |nUNFORMAT|n /L finds a file that is fragmented, it will ask you whether
  707. it should truncate the file (cut it off at the end of the last contigu-
  708. ous cluster) or delete it (so that you can try to manually undelete it
  709. with a utility such as PC Tools or the Norton Utilities).  Unless you
  710. know an awful lot about manual undeletion, you won't be able to do any-
  711. thing with it so go ahead and say Truncate so that at least you get part
  712. of the file back.  Of course this only applies to data files.  If it's an
  713. executable file, go ahead and say Delete because it won't be a bit useful
  714. anymore.
  715.  
  716.  
  717.  
  718.  
  719.  
  720.  
  721.                            The |TUNDELETE|T Command
  722.  
  723. This command is new to DOS version 5.0, but it's been around for a while.
  724. Microsoft licensed it from Central Point Software, the publishers of PC
  725. Tools.  It does just what its name implies.
  726.  
  727. First of all, the DEL and ERASE commands have never deleted any of the
  728. data in your files.  All they do is erase the FAT entry, and the first
  729. letter of the filename in the directory entry.  They don't even touch the
  730. file.  Well the |ndirectory|n entry tells the location of the beginning of
  731. the file, so all that's missing after a file has been deleted, is the
  732. first letter of the filename, right?  That should be really easy to fix.
  733. Wrong.  Because the |ndirectory|n entry tells the location of only the begin-
  734. ning of the file, not all the other little pieces of a file.  That's what
  735. the |nFAT|n does.  It tells the location of all the other parts of the file
  736. after the first.  This is especially important for fragmented files!
  737.  
  738. Well, if you've been running the MIRROR program with its deletion track-
  739. ing TSR, then it's been saving a record of the |nFAT|n and |ndirectory|n entries
  740.                            <page down> for more
  741.                             UNDELETE continued
  742. for every file you've deleted.  So as long as neither you, nor DOS, nor
  743. any other program has written any data, including the temp files caused
  744. by the DOSSHELL or any redirection operations involving the || symbol, to
  745. the spot on the disk where that file was, then the |nUNDELETE|n command can
  746. easily, immediately, and perfectly restore any file you delete.
  747.  
  748. Even if you weren't running |sMIRROR|s's delete tracker, as long as no data
  749. has been written on top of the deleted file, the |nUNDELETE|n command has a
  750. chance of being able to work.  As long as the file was not fragmented, it
  751. will be able to restore everything except the first letter of the file-
  752. name.  Well you can just use the RENAME command to fix that part.  If the
  753. file was |nfragmented|n, you're in trouble.  If the file in question is on a
  754. floppy disk, make a DISKCOPY of it and see what the |nUNDELETE|n command can
  755. do for you, but only on the copy, not the original.  If it doesn't work,
  756. you still have the original so you can take it to someone who knows more
  757. about manual undeletion than you do.
  758.  
  759. Think long and hard whenever you're about to use the RMDIR command, be-
  760.                            <page down> for more
  761.                             UNDELETE continued
  762. cause the |nUNDELETE|n command cannot bring back a directory, or any files
  763. that were in a |ndirectory|n after it's been |sRMDIR|sed.  If the |ndirectory|n is a
  764. branch right off the root |ndirectory|n, then the UNFORMAT command might be
  765. able to get it back, and then you could use the |nUNDELETE|n command to re-
  766. trieve the files that were in that |ndirectory|n.  But it's not a good idea
  767. to go around using the |nUNFORMAT|n command just for one |ndirectory|n.  It could
  768. do more harm than good.
  769.  
  770. Here's the syntax for this command:
  771.           |nUNDELETE|n D:\DIR\FILENAME.EXT /ALL /DOS /DT /LIST
  772. If you leave out the file specification there, then the command will un-
  773. delete all the deleted files in the current |ndirectory|n.
  774.  
  775. The /LIST switch doesn't undelete any files.  It just shows you which
  776. files are available for undeletion, depending on whether you specify the
  777. /DOS or /DT switch with the /L one.
  778.  
  779. The /ALL switch just goes right ahead and undeletes all the files that
  780.                            <page down> for more
  781.                             UNDELETE continued
  782. there are to be undeleted, without asking for permission or anything.  If
  783. there is no delete tracking file to help, it will put a # sign in place
  784. of the first character in each filename, and you can use the RENAME com-
  785. mand to give the files back their real names.
  786.  
  787. The /DOS switch tells |nUNDELETE|n to ignore any delete tracking file and
  788. just do what it can from the information in the deleted file's directory
  789. entry.
  790.  
  791. The /DT switch undeletes only the files that have information stored for
  792. them in the deletion tracking file.
  793.  
  794. If you don't specify any of these switches, the |nUNDELETE|n command will use
  795. the delete tracker file if it exists, otherwise it will try the DOS meth-
  796. od with just the |ndirectory|n entry to go on.
  797.  
  798.  
  799.  
  800.  
  801.                            |tBoot|ting and |tReboot|ting
  802.  
  803. To "boot" a computer just means to turn on the power.  This term comes
  804. from the expression "pulling oneself up by the bootstraps".  You see,
  805. when a computer is not receiving any |npower|n, it obviously doesn't have
  806. any software loaded into memory, so the computer is quite stupid at that
  807. time.  When you turn on the |npower|n, the computer loads the operating |nsys|n-
  808. tem (DOS) into |nmemory|n, and suddenly it has become a useful piece of mach-
  809. inery.  So that's sort of analogous to the way a bum in the gutter might
  810. "pull himself up by the bootstraps" and make something of himself.
  811.  
  812. To "reboot" a computer means to remove everything from the computer's
  813. |nmemory|n and have it reload the operating system from the disk, just as if
  814. the |npower|n had been turned off and back on.  There are two different types
  815. of |nreboot|n, and several ways to accomplish each.  (See also Boo|1t Disk.)
  816.  
  817. First, a "cold boot" or "hard reboot" means to actually remove and re-
  818. apply |npower|n.  This is necessary sometimes when the computer has "crashed"
  819. so hard that a warm |nboot|n won't even work.  And that's the only time you
  820.                            <page down> for more
  821.                          Boot and Reboot continued
  822. want to perform a cold |nboot|n, because a warm |nboot|n is a little bit easier
  823. on the computer's components.  That's why a warm |nboot|n is also known as a
  824. "soft |nreboot|n".
  825.  
  826. A "warm boot" does not actually remove power from the computer, it just
  827. clears out the RAM completely, causing the computer to reload DOS from
  828. the disk.  It fulfills the same function that a cold |nboot|n does, without
  829. the shock to the system that is caused whenever |npower|n is reapplied to the
  830. components.
  831.  
  832. So how do you accomplish a |nreboot|n?  The easiest way is to hold the <Ctrl>
  833. and <Alt> keys down, and hit the <Del> key.  The Ctrl-Alt-Del method per-
  834. forms a warm or soft |nreboot|n.  There are also some public domain software
  835. programs that can perform a warm |nboot|n from within a batch file.
  836.  
  837. Other |npublic domain|n programs can do a cold |nboot|n.  Another way is to just
  838. turn the |npower|n switch off and back on.  But please, wait at least thirty
  839. seconds between turning it off and turning it back on, to allow the hard
  840.                            <page down> for more
  841.                          Boot and Reboot continued
  842. drive and the fan to stop spinning.  It's best if you turn it off, then
  843. go get a cup of coffee or something, then come back and turn it back on.
  844. Remember that the hard drive is spinning at some amazing speed like 3000
  845. revolutions per minute, the whole time it's on.  Slowing it down (turn-
  846. ing it off) and speeding it up (turning it back on) so quickly like that
  847. is not good for it.
  848.  
  849. If you have a reset button on the front panel of your computer, it may
  850. perform a warm or cold |nreboot|n, depending on the brand and model of your
  851. machine.  The easiest way to tell, is to see if your computer performs
  852. the |TPOST|T when this button is pressed, or not.  Power-On Self Test is what
  853. that stands for, and it is performed by a program that's stored in a ROM
  854. chip on your motherboard.  This test is only performed when the power is
  855. turned on, so obviously if your reset button causes the computer to do
  856. the |nPOST|n then it's doing a cold |nboot|n.  If your screen shows a little num-
  857. ber up in the top left corner that counts up in increments of 64, then it
  858. is testing your RAM and that's part of the |nPOST|n.  If your reset button
  859. does not cause the |nRAM|n test to occur, then it's doing a warm |nboot|n.
  860.                            <page down> for more
  861.                          Boot and Reboot continued
  862. The problem with rebooting a computer is that even if you didn't do it
  863. on purpose, it stills clears out every byte of everything in memory.  So
  864. save your work to disk, often!  That way, if your computer locks up and
  865. you're forced to |nreboot|n, then you only lose a little bit of work, what-
  866. ever you've done since the last time you saved to disk.
  867.  
  868. See the section about the SHELL command for a quick description of what
  869. the computer does while it's booting.
  870.  
  871.  
  872.  
  873.  
  874.  
  875.  
  876.  
  877.  
  878.  
  879.  
  880.  
  881.                            What Is |tCOMMAND.COM|t?
  882.  
  883. This is one of the top three most important files on your system.  The
  884. others are IO.SYS and MSDOS.SYS for MS-DOS, or IBMBIO.COM and IBMDOS.COM
  885. for PC-DOS.  Without these three files in the right place so that the
  886. computer knows where to find them, the computer can't even boot up.
  887.  
  888. |nCOMMAND.COM|n is the part of DOS that interprets every command you type in
  889. at the DOS prompt.  It also has lots of commands inside of it, and these
  890. are called internal commands.  Here is a list of them:
  891.       BREAK   CLS    DEL     EXIT   LOADHIGH   PROMPT   SET        TYPE
  892.       CALL    COPY   DIR     FOR    MKDIR      REM      SHIFT      VER
  893.       CHCP    CTTY   ECHO    GOTO   PATH       RENAME   TIME       VERIFY
  894.       CHDIR   DATE   ERASE   IF     PAUSE      RMDIR    TRUENAME   VOL
  895. As long as your version of DOS includes these commands, you can enter any
  896. of them at any |nprompt|n, any time, whether you have a PATH variable in your
  897. environment at the moment, or not.  (|sGOTO|s, PAUSE, REM, and SHIFT are
  898. batch file commands that have no useful purpose at the command line.)
  899.  
  900.                            <page down> for more
  901.                            COMMAND.COM continued
  902. These are some other commands that can sort of be considered as internal
  903. commands, because the code that tells DOS how to execute them is inside
  904. the IO.SYS file (or the IBMBIO.COM file if you're using PC-DOS), and they
  905. can only be used from within the CONFIG.SYS file, not at the command line
  906. or from a batch file or anything like that:
  907.     BREAK   COUNTRY DEVICEHIGH DRIVPARM FILES   LASTDRIVE SHELL  SWITCHAR
  908.     BUFFERS DEVIC|1E  DO|1S        FCBS     INSTALL REM       STACKS SWITCHES
  909. They're really not referred to as internal commands, though.  They're
  910. usually just called |nCONFIG.SYS|n commands.  (Yes, BREAK and REM are both
  911. internal commands and |nCONFIG.SYS|n commands.  The code that executes them
  912. is in both the IO file and the |nCOMMAND.COM|n file, so they can be executed
  913. from |nCONFIG.SYS|n or the command line or a |nbatch file|n.)
  914.  
  915. All the rest of the DOS commands are external, and that means that in
  916. order to execute them you have to have the executable file by that name
  917. available to DOS in order for DOS to run the command.
  918.  
  919. See also SHELL, COMSPEC, and Shelling Out for more information.
  920.  
  921.                              The |TPAUSE|T Command
  922.  
  923. This command is only useful in a batch file.  You can put this command
  924. into any |nbatch file|n, and when it executes, when DOS gets to the |nPAUSE|n
  925. line, it will write "Press any key to continue . . ." on your screen, and
  926. it will just sit and wait for you to press a key.  If you press <Ctrl-C>
  927. or <Ctrl-Break>, then DOS will allow you to BREAK out of the |nbatch file|n
  928. and go back to the DOS prompt without finishing the rest of the commands
  929. in the |nbatch file|n.  Or, when DOS asks you "Terminate batch job (Y/N)?"
  930. you can say N instead, and DOS will continue on with the next command in
  931. the |nbatch file|n after the one that DOS was working on, at the time you
  932. pressed <Ctrl-Break> or <Ctrl-C>, which in this case was the |nPAUSE|n com-
  933. mand.  Well if, instead of one of those two keystroke combinations, you
  934. press any other key, then the |nbatch file|n will continue on with what it
  935. was doing.
  936.  
  937. This is especially useful for three purposes.  First, whenever you need
  938. to allow the user a moment to do something like put a different floppy
  939. disk into drive A: or turn the printer on.
  940.                            <page down> for more
  941.                               PAUSE continued
  942. Second, whenever you want to be sure to allow the user the opportunity to
  943. BREAK out of the batch file with the <Ctrl-C> keystroke.  The <Ctrl-C> or
  944. <Ctrl-Break> keystroke generally allows anyone to break out of a batch
  945. file at any time, more or less, but if you want to be absolutely sure the
  946. user will be able to get out if desired, at a certain point in the batch
  947. file, without a doubt, then put a |nPAUSE|n command into the |nbatch file|n at
  948. that point.
  949.  
  950. Third, whenever you're working on creating a |nbatch file|n, and you're not
  951. sure you have the exactly correct commands in it, you can remove the |nECHO|n
  952. OFF line from the beginning, if you had it there, and insert |nPAUSE|n com-
  953. mands every two or three lines, so that you can execute the |nbatch file|n
  954. and watch what happens without trying to read the screen so fast as it
  955. scrolls by.  You'll have plenty of time to look and see what the batch
  956. file is doing, so you can figure out which parts aren't working right.
  957.  
  958. You can type whatever you want after the |nPAUSE|n command, on the same line
  959. with it, without affecting anything.  If ECHO is on, then the whole com-
  960.                            <page down> for more
  961.                               PAUSE continued
  962. mand, including whatever you might have typed after it, will be displayed
  963. on the screen.  But if echo is off, only the message "Press any key to
  964. continue . . ." will show up, so you probably want to precede the |nPAUSE|n
  965. command in the batch file with an ECHO command to tell the user what it
  966. is that DOS is pausing to wait for.
  967.  
  968. You might want to make the computer's speaker beep along with a |nPAUSE|n
  969. command, to alert the user that the computer is waiting for a keystroke,
  970. in case he walked off to do something else while that |nbatch file|n exec-
  971. utes.  To put a beep into a |nbatch file|n, you need ASCII character 7, which
  972. is called BEL.  To enter an |nASCII|n character 7 you can hold down the <Alt>
  973. key and type a 7 on the numeric keypad.  If a ^G appears on your screen,
  974. you know it worked.  (Some text editors won't properly accept such input
  975. from the <Alt-number> method.)  If you're using EDLIN to create a batch
  976. file, there's another way to do it also.  Just type |nECHO|n ^VG where the
  977. ^ symbol means to hold down the <Ctrl> key while typing the next letter.
  978. The ^V tells |nEDLIN|n that the next character you enter should be interpret-
  979. ed as a control character, so ^VG puts the |nASCII|n 7 character into the
  980.                            <page down> for more
  981.                               PAUSE continued
  982. file.  (The next time you list that file to the screen, the V will be
  983. missing, but that's ok; it's served its purpose and the computer knows
  984. now that the G is really supposed to be a <Ctrl-G> or BEL character.)
  985. Now whenever you type that file to the screen with the TYPE command, or
  986. execute it by typing the name of the batch file itself, your computer
  987. will ring its bell (beep its speaker).  So just put the |nPAUSE|n command
  988. right after that line, or of course if your |nbatch file|n does not have ECHO
  989. off, you can just place these ASCII 7 or ^G characters on the |nPAUSE|n com-
  990. mand line instead of using a separate |nECHO|n command.
  991.  
  992.  
  993.  
  994.  
  995.  
  996.  
  997.  
  998.  
  999.  
  1000.  
  1001.                               The |TREM|T Command
  1002.  
  1003. This command has no use except in the CONFIG.SYS file or in a batch file.
  1004. It stands for REMark.  All it does is tell DOS to "ignore this line".  So
  1005. that you can insert little comments into your |nCONFIG.SYS|n and batch files,
  1006. to remind you of what a certain command is supposed to accomplish, so you
  1007. don't wonder six months from now why you wrote what you did.
  1008.  
  1009. Also, if you want to temporarily disable a line from a |nbatch file|n or from
  1010. the |nCONFIG.SYS|n file, without removing it permanently, you just insert the
  1011. word |nREM|n and a <Space> at the beginning of the line, and DOS will ignore
  1012. that line when it executes the file.  Of course in a |nbatch file|n, an even
  1013. easier way to temporarily disable a line is to just put a colon (:) in
  1014. front of it.  That way, DOS will think it's just a label for the GOTO
  1015. command, so DOS will totally ignore that line as long as there isn't a
  1016. |nGOTO|n command in the file that uses a label by the same name as the first
  1017. word in the line you're disabling.
  1018.  
  1019. If you want the REMark to display on the screen as a |nbatch file|n executes,
  1020.                            <page down> for more
  1021.                                REM continued
  1022. you have to have echo on.  In fact, if echo is on, |nREM|n is the best way to
  1023. display a line on the screen, because the ECHO command will display the
  1024. line twice if echo is on.
  1025.  
  1026. |nREM|n was not a valid CONFIG.SYS command until DOS version 4, so if you use
  1027. it in a |nCONFIG.SYS|n file in an earlier version, you'll get an error mess-
  1028. age "Unrecognized command", but it won't hurt anything.  It will only
  1029. look like something is wrong with your |nCONFIG.SYS|n file as it executes.
  1030. As long as there's only the one error message, and you remember that it's
  1031. because of the "REMmed out" statement, then you'll be fine.
  1032.  
  1033. Which reminds me, I'd better warn you that a lot of people will go around
  1034. telling you to "|nREM|n out" a line in a |nCONFIG.SYS|n or batch file, and expect
  1035. you to understand what they're talking about.  Well what they're talking
  1036. about is just putting the word |nREM|n and a <Space> in front of the line in
  1037. question, so that DOS will ignore that line the next time the file gets
  1038. executed.
  1039.  
  1040.  
  1041.                             The |TGWBASIC|T Command
  1042.  
  1043. This is the command which runs the GW-BASIC interpreter.  What on earth
  1044. does that mean?  Well GW-BASIC is Microsoft's specific brand name for
  1045. BASIC, which is a very simple (compared to most) programming language.
  1046. Now the GW-BASIC version of BASIC does not include a compiler.  A compil-
  1047. er is what turns some programmer's source code into a .COM or .EXE file.
  1048. GW-BASIC doesn't make .COM or .EXE files; it only makes .BAS files, and
  1049. those are not executable.  So you need the GW-BASIC interpreter to tell
  1050. the computer what your source code (the .BAS file) means.  Because the
  1051. computer can't understand BASIC without the interpreter, until it's been
  1052. compiled (converted to a .COM or .EXE file).
  1053.  
  1054. To run a program whose filename ends in .BAS, you just type |nGWBASIC|n fol-
  1055. lowed by the first name of that program file.  For example, if you have a
  1056. file named MUSIC.BAS that you would like to run, you type |nGWBASIC|n MUSIC.
  1057. And the GW-BASIC interpreter will load into your computer's memory, and
  1058. load that MUSIC.BAS file from your disk into |nmemory|n also, and then exec-
  1059. ute the instructions that are inside the MUSIC.BAS file.  Of course, if
  1060.                            <page down> for more
  1061.                              GWBASIC continued
  1062. the MUSIC.BAS file is not in the current directory of your |ncurrent|n drive,
  1063. you'll have to tell GW-BASIC where to find it, as in |nGWBASIC|n C:\GW\MUSIC.
  1064.  
  1065. If you have PC-DOS rather than MS-DOS, then you want to use the BASICA
  1066. command rather than the |nGWBASIC|n command, which you don't have anyway.
  1067. It's just the same thing, except for one difference.  The BASICA command
  1068. won't run on a non-IBM computer, because IBM computers have a part of the
  1069. BASIC code stored in ROM, and the BASICA command depends on that code for
  1070. its operation.  If you try to run this command on a computer that isn't a
  1071. true-blue IBM, the code will just sit there all day long looking for that
  1072. piece of |nROM|n that has the rest of the BASIC code in it, and you can't do
  1073. a thing about it except reboot.  So that's why people with clones (compu-
  1074. ters that are compatible with IBM but are not manufactured by IBM) are
  1075. not supposed to be using PC-DOS.  Because PC-DOS doesn't have the |nGWBASIC|n
  1076. command, and the BASICA command won't run on a clone.
  1077.  
  1078. If you have DOS version 5, you have the QBASIC command instead of BASICA
  1079. or |nGWBASIC|n.  It's just about the same thing, only better.  But the same
  1080.                            <page down> for more
  1081.                              GWBASIC continued
  1082. rules apply about trying to use PC-DOS's QBASIC command on a non-IBM com-
  1083. puter.  It won't work.
  1084.  
  1085. If you run |nGWBASIC|n without a filename, it will just load and sit there
  1086. showing you its prompt, and waiting for you to tell it what to do.  (The
  1087. GW-BASIC |nprompt|n is just _, an underline, which is usually preceded by an
  1088. OK message.)  If you want to get back to DOS just type SYSTEM and hit
  1089. <Enter>.  Otherwise, go get yourself a nice BASIC book and check it out.
  1090. It really is a lot easier than other programming languages.
  1091.  
  1092. The name BASIC, by the way, stands for Beginners' All-purpose Symbolic
  1093. Instruction Code.
  1094.  
  1095. If you have a special proprietary version of DOS, like from the Kaypro
  1096. company or the COMPAQ company or the Zenith company, you might have a
  1097. command named BASIC instead of |nGWBASIC|n.  But it's just the same thing,
  1098. only optimized to run best on your specific brand of computer.
  1099.  
  1100.  
  1101.                             The |TRENAME|T Command
  1102.  
  1103. This command can be abbreviated as REN.  In fact, many people don't even
  1104. realize that |nRENAME|n is a valid command; they think that REN is the whole
  1105. command, not its abbreviation.
  1106.  
  1107. It is used to give a file a different name from the name it has now.  The
  1108. syntax is really easy.
  1109.           |nRENAME|n D:\DIR\FILENAME.EXT FILENAME.EXT
  1110. Of course if the file is in the current directory of the |ncurrent|n drive,
  1111. you can leave out the D:\DIR\ part.  But you can't specify a |spath|sname for
  1112. the second filename, since you can't rename a file to a different place.
  1113. (For that you want the COPY command.)
  1114.  
  1115. You could also do something like rename all your .TXT files to have .DOC
  1116. extensions, all in one command, like this:
  1117.           |nRENAME|n FILE*.TXT *.DOC
  1118. Notice that wildcards on the target side of the equation have a different
  1119. meaning than |nwildcards|n on the source side.  FILE*.TXT means "every file
  1120.                            <page down> for more
  1121.                              RENAME continued
  1122. that has FILE as the first four letters of its first name, and a .TXT
  1123. extension", but *.DOC means "the same first name as the source files but
  1124. with the extension .DOC".  It won't do a thing to any files you might
  1125. already have, with .DOC extensions, or to any files with .TXT extensions
  1126. that don't have FILE as the first four letters.  On the target side of
  1127. the equation, wildcards just tell DOS to leave this part the same as it
  1128. was on the source side.  So you could say |nRENAME|n |nCONFIG.SYS|n *.BAK to save
  1129. typing the word CONFIG twice.
  1130.  
  1131. If you try to rename a file to a name that some other file in the same
  1132. directory already has, you'll get a "Duplicate filename" error message.
  1133. You can't do that.  Every file in a |ndirectory|n has to have its own unique
  1134. name.  Either delete the file that already has that name, or COPY the
  1135. source file over top of it, or else choose a different name and try the
  1136. |nRENAME|n command again.
  1137.  
  1138. If you ever give a file a name with a <Space> in it, like FILE ONE.TXT,
  1139. you won't be able to do anything with that file.  DOS doesn't allow spac-
  1140.                            <page down> for more
  1141.                              RENAME continued
  1142. es in filenames, so it won't let you delete or anything else, with such
  1143. an invalid name.  But you can use a |nRENAME|n command with wildcards to fix
  1144. that problem right up.  |nRENAME|n FILE?ONE.TXT FILEONE.TXT will do it, be-
  1145. cause the ? wildcard stands for "any character in this position of the
  1146. filename" so that will take care of the <Space>.  And now the file has a
  1147. valid name, so you can do whatever you want with it.
  1148.  
  1149. If you have a filename that's so badly garbled (probably because of mag-
  1150. netic damage to the directory entry) that the ? wildcard method won't
  1151. work, try this one:
  1152.           |nXCOPY|n |n*.*|n NEWNAME /P
  1153. Now the /P switch will cause the XCOPY command to stop and ask you before
  1154. it copies each file, so you want to say no to all the files except the
  1155. damaged filename.  The file with the damaged name will be copied to the
  1156. NEWNAME file, and then if you have DOS version 4 or later (don't even try
  1157. this if you don't have version 4, because the /P switch didn't exist for
  1158. the DEL command before that), you can use the same trick with |nDEL|n |n*.*|n /P
  1159. and say no to every file except the funky one.  There, now the bad file-
  1160.                            <page down> for more
  1161.                              RENAME continued
  1162. name is gone and the file is still there, under the new name.  If you
  1163. have more than one filename that's damaged like that, you have to start
  1164. up the XCOPY command again and this time say something like |nXCOPY|n |n*.*|n
  1165. NEWFILE2 /P, because you won't be able to copy any other files to the
  1166. NEWNAME filename without overwriting the one you just created by that
  1167. same name.  You'll have to specify another target filename.
  1168.  
  1169. You can rename all your external DOS commands (the ones that have disk
  1170. files, that are not stored inside the COMMAND.COM file) to whatever names
  1171. you want them to have.  You can |nRENAME|n |nFORMAT|n.COM FORM.COM to make it
  1172. shorter to type, or you can |nRENAME|n |nRECOVER|n.COM BAD.COM so you remember
  1173. that you don't ever want to use that command.  But if you do any renaming
  1174. of DOS commands, or any other commands, just remember that if any other
  1175. program or batch file calls those commands, they won't be able to find
  1176. those commands under the new name because they're still looking for the
  1177. old command names.  (For batch files that's easy to fix; just edit the
  1178. file to replace the old command name with the name that you changed it
  1179. to.)  Another reason this can give you trouble is that if you go over to
  1180.                            <page down> for more
  1181.                              RENAME continued
  1182. your friend's house to help him with his computer, and you go to format a
  1183. disk and you type FORM A: because that's what you're used to on your com-
  1184. puter, well of course your friend's FORMAT command is still named |nFORMAT|n
  1185. .COM and your friend might think you're not as smart as you think you are
  1186. because you'll get a "|sBad command or filename|s" message.
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192.  
  1193.  
  1194.  
  1195.  
  1196.  
  1197.  
  1198.  
  1199.  
  1200.  
  1201.                             The |TRECOVER|T Command
  1202.  
  1203. This is a command you want to be very careful with.  In fact you might
  1204. want to remove it from your disk, or RENAME it to DESTROY or something,
  1205. so that you don't ever use it accidentally.
  1206.  
  1207. What it's supposed to be used for, is to retrieve one file at a time, no
  1208. more than one at a time, from a disk that has been damaged.  You see,
  1209. when DOS finds a file that has a bad spot in it, DOS just won't do any-
  1210. thing with any part of the file.  Well, the way to get back all the read-
  1211. able parts is with the |nRECOVER|n command.  The syntax is:
  1212.           |nRECOVER|n D:\DIR\FILENAME.EXT
  1213. and as usual, if the file in question is in the current directory of the
  1214. |ncurrent|n drive, you can leave that part out and say |nRECOVER|n FILENAME.EXT.
  1215. This will cause DOS to take the readable parts of the file and stick them
  1216. into a file with the same name, but in the root |ndirectory|n of the disk in
  1217. question.  It will also mark the bad sectors as "in use" in the FAT, so
  1218. that DOS never tries to stick any more data in that spot. So, now what do
  1219. you do with it?  Well, if it used to be a .COM or .EXE file, you're going
  1220.                            <page down> for more
  1221.                              RECOVER continued
  1222. to delete it.  It's got a chunk missing out of the middle, where the bad
  1223. sector was, so there's no telling what it might do to your computer if
  1224. you try to run it.  (But don't just delete it instead of RECOVERing it!
  1225. Because if you |nRECOVER|n it first, then the bad sector will be marked as
  1226. bad in the FAT so DOS will never try to put a file in that spot again.)
  1227. If it was a word processor or spreadsheet file, on the other hand, well,
  1228. at least you got most of it back, right?  It's better than losing the
  1229. whole file.  You just have some work to do, to put it back to its prev-
  1230. ious shape.  (If you kept |sbackup|ss like you're supposed to, you wouldn't
  1231. have such problems.)
  1232.  
  1233. Note that the |nRECOVER|n command always works with full sectors, so there
  1234. will be an exact multiple of 512 bytes missing from wherever the bad sec-
  1235. tors were, and then at the end there will probably be a little extra data
  1236. stuck on there too, because |nRECOVER|n will take the entire last sector of
  1237. the file, even the part of that sector which came after the end of the
  1238. file, which would probably be some leftover data from an old file that
  1239. you deleted ages ago.
  1240.                            <page down> for more
  1241.                              RECOVER continued
  1242. All right, that's fine, it sounds like it will work for just one file at
  1243. a time.  But if you have a floppy disk that's a total wreck and a whole
  1244. bunch of files are giving "Data error reading drive A:" messages, do you
  1245. have to use the |nRECOVER|n command on every file separately?  Well, it's not
  1246. a bad idea.  It's a heck of a lot more sensible than RECOVERing the whole
  1247. disk.  You can't use wildcards with this command; your only choices are
  1248. one file at a time, or the whole disk at a time.  And RECOVERing a whole
  1249. disk at a time is just about the silliest thing you could possibly do,
  1250. unless the directory itself is what has the bad sectors.
  1251.  
  1252. If you really have a disk with hardly anything but bad sectors, the first
  1253. thing you should do is make a DISKCOPY of it and try to |nRECOVER|n the copy,
  1254. not the original.  That way, if the recovery operation is a big flop, you
  1255. can take the original and start over, only this time take it to a friend
  1256. who has PC Tools or the Norton Utilities running.
  1257.  
  1258. Next, use XCOPY with the /S switch to get all the data you can from that
  1259. disk, onto some other disk, then whichever files get copied successfully,
  1260.                            <page down> for more
  1261.                              RECOVER continued
  1262. delete those from the damaged disk.  And if the copying and deleting emp-
  1263. tied any subdirectories on the disk, then RMDIR them.  That way there
  1264. won't be so many files left on the disk to get mixed up.  Now, the only
  1265. files left on the disk are the damaged ones, so |nRECOVER|n and then delete
  1266. each of the .COM and .EXE files too, because even if you |nRECOVER|n them you
  1267. won't be able to use them, for the reason stated above.  Now all that's
  1268. left is the data files that need to be recovered.
  1269.  
  1270. If you have a disk where the directory structure itself is what has the
  1271. bad sectors, you won't be able to access any files on the disk at all.
  1272. First, make a DISKCOPY of it, and then use the |nRECOVER|n command on the
  1273. copy.  Or if you have a |nbackup|n copy of the disk, just trash the damaged
  1274. one and forget about the |nRECOVER|n command.
  1275.  
  1276. To |nRECOVER|n a whole disk, the syntax is |nRECOVER|n D: and that's all there is
  1277. to it.  All the files on the whole disk, including the subdirectories
  1278. themselves, will be RECOVERed and you'll end up with a root |ndirectory|n
  1279. full of nothing but FILE####.REC files, because that's what the |nRECOVER|n
  1280.                            <page down> for more
  1281.                              RECOVER continued
  1282. command will name them.  FILE0001.REC, FILE0002.REC, etc.  If there are
  1283. too many files to fit in the root directory (remember that there is a lim-
  1284. it to the number of entries allowed in any |nroot|n |ndirectory|n), the command
  1285. will stop, and you should COPY the .REC files to another disk and delete
  1286. them from the damaged disk, and enter the |nRECOVER|n command again so it can
  1287. finish the rest of the disk.
  1288.  
  1289. If you ever accidentally use the |nRECOVER|n command on a disk when you meant
  1290. to use RESTORE instead, or if you just didn't know what horrible things
  1291. |nRECOVER|n would do to your files, then do not pass GO, do not collect $200,
  1292. just go straight to PC Tools or the Norton Utilities or if you have DOS
  1293. version 5, the UNFORMAT command.  If it's a floppy disk, make a DISKCOPY
  1294. of it first though, in case the Utilities don't work the first time, you
  1295. can start over on the copy.
  1296.  
  1297. There's one other thing the |nRECOVER|n command is useful for, though.  If
  1298. you have a |nfloppy|n disk from which you want to ERASE all the files, but
  1299. the disk has subdirectories on it, you would have to delete all of the
  1300.                            <page down> for more
  1301.                              RECOVER continued
  1302. files from one subdirectory, RMDIR the directory, delete the files from
  1303. the next subdirectory, remove it, etc, and then delete all the files in
  1304. the root |ndirectory|n.  Well there is an easier way, if you're absolutely
  1305. positive that you want that whole disk erased.  |nRECOVER|n A: will put all
  1306. the files into the |nroot|n |ndirectory|n, and convert the subdirectories to
  1307. files, and put them in the |nroot|n |ndirectory|n too, so that |nDEL|n A:\*.* will
  1308. remove everything from the whole disk.  Hey, wouldn't it be easier to
  1309. just re|sFORMAT|s the disk?  Yes, it would, but this is just an example of
  1310. another way to skin a cat.
  1311.  
  1312.  
  1313.  
  1314.  
  1315.  
  1316.  
  1317.  
  1318.  
  1319.  
  1320.  
  1321.                               The |TVER|T Command
  1322.  
  1323. This command is super simple to explain, but then again it doesn't do
  1324. anything useful, either.  It just tells DOS to show you the name and
  1325. number of the DOS version you're running.  It might look like this:
  1326.           C:\>VER
  1327.           MS-DOS Version 5.00
  1328. And if you have version 5, there is an undocumented switch, /R.  Here
  1329. is its output:
  1330.           C:\>VER /R
  1331.           MS-DOS Version 5.00
  1332.           Revision A
  1333.           DOS is in HMA
  1334. And that does mean the version you |sboot|sed the computer with, not just
  1335. whatever version is installed on the current drive or anything.
  1336.  
  1337.  
  1338.  
  1339.  
  1340.  
  1341.                               The |TVOL|T Command
  1342.  
  1343. This command isn't any more fun than VER.  All it does is tell you the
  1344. volume label of a disk.  Like this:
  1345.           C:\>VOL C:
  1346.           Volume in drive C is WHATEVER
  1347.           Volume Serial Number is 16CB-74E4
  1348.  
  1349. You could get the same information and more, from the DIR, CHKDSK, or
  1350. LABEL commands.
  1351.  
  1352. Of course if you have DOS version 3.3 or earlier, you won't have a ser-
  1353. ial number on your disks.
  1354.  
  1355. The volume label is stored as an entry in the root directory of the disk,
  1356. even though it doesn't take up any disk space.  The |nCHKDSK|n command will
  1357. count it as a Hidden file, because |nCHKDSK|n doesn't understand the Volume
  1358. attributes, so it interprets them as Hidden |nattributes|n instead.
  1359.  
  1360.  
  1361.                              The |TSHARE|T Command
  1362.  
  1363. This is a TSR that you need to load every time you boot up, if you are on
  1364. a Network or if you are using DOS version 4 and you have one or more hard
  1365. drive partitions of a size over 32 mega|sbytes|s.  I mean it, if you have any
  1366. logical drives that are larger than 32 megs and you are using DOS version
  1367. 4 then you have got to load |nSHARE|n or really terrible things will happen
  1368. to your data.  This is not an idle threat.  DOS didn't really and truly
  1369. learn how to deal with these large drives until version 5, although in
  1370. version 4 it became possible to have them that big.  |nSHARE|n is the only
  1371. thing that makes it safe to have those large partitions under version 4.
  1372.  
  1373. It's easy to make |nSHARE|n load itself every time you |nboot|n up.  Just make
  1374. sure the |nSHARE|n.EXE file is located in the same directory that contains
  1375. your COMMAND.COM file, and DOS will load it automatically.  Or, if for
  1376. some reason that's not working, then put INSTALL=C:\DOS\SHARE.EXE into
  1377. your CONFIG.SYS file and that will definitely load it.  Of course then
  1378. make sure the |nSHARE|n.EXE file is in the C:\DOS |ndirectory|n where you told
  1379. |nCONFIG.SYS|n it was at.
  1380.                            <page down> for more
  1381.                               SHARE continued
  1382. Now if you have DOS version 4 and a large hard drive partition, and DOS
  1383. doesn't find the |nSHARE|n.EXE file in order to load it, it'll give you this
  1384. error message:  "Warning!  |nSHARE|n must be loaded for large media".  (Media
  1385. just means the type of disks you're using.)  You can also use |nSHARE|n from
  1386. the AUTOEXEC.BAT file, but if you do, you will still receive that error
  1387. message, because that message comes up before the |nAUTOEXEC.BAT|n file gets
  1388. read, so DOS will just think that you were planning to skip the loading
  1389. of |nSHARE|n.  Besides, if something that comes earlier in |nAUTOEXEC.BAT|n than
  1390. the |nSHARE|n command, is something that writes to the disk, then you're in
  1391. trouble since |nSHARE|n has not been loaded yet.  So it's really best to use
  1392. one of the other methods to load |nSHARE|n.
  1393.  
  1394. Another thing that |nSHARE|n does in version 4, is it checks the serial num-
  1395. ber on your floppy disk before it allows anything to be written to it, to
  1396. make sure you didn't change |ndisks|n.  That way, DOS won't trash the flop-
  1397. py's FAT by writing info that was supposed to go on one disk, to another
  1398. disk, after you changed |ndisks|n without DOS realizing it.
  1399.  
  1400.                            <page down> for more
  1401.                               SHARE continued
  1402. But on the other hand, another thing that |nSHARE|n does is to refuse to let
  1403. you do a bunch of things you might want to do.  It thinks it's protecting
  1404. your hard drive, but sometimes it just gets a little carried away.  So
  1405. when I first got DOS 4 and an 85 meg hard drive, I only used |nSHARE|n for
  1406. about three days before I got fed up and decided to use FDISK to repar-
  1407. tition my drive into smaller logical drives, so that I didn't need to use
  1408. |nSHARE|n anymore.  You might end up doing the same thing.  Then again, if
  1409. you just get DOS version 5, you can have a partition as large as you want
  1410. without needing |nSHARE|n.
  1411.  
  1412.  
  1413.  
  1414.  
  1415.  
  1416.  
  1417.  
  1418.  
  1419.  
  1420.  
  1421.                             The |TSTACKS|T Command
  1422.  
  1423. This command can only be used in a CONFIG.SYS file.  About the only time
  1424. you'll ever want to use this command, is to set it like this to save mem-
  1425. ory:
  1426.           STACKS=0,0
  1427.  
  1428. But if you ever get an error message such as "Stack overflow", or if your
  1429. system locks up when you type too fast, then you'll want to remove that
  1430. command again to make DOS use the default values.  (The |ndefault|n for 8088
  1431. computers already is 0,0 but for 286 or higher, the |ndefault|n is 9,128.)
  1432.  
  1433. If you still get that error message, try a command like STACKS=15,128 or
  1434. even 20,512 if necessary.  Other than 0,0 the other acceptable values are
  1435. anywhere from 8,32 to 64,512.
  1436.  
  1437. The first number means number of stacks, and the second means number of
  1438. bytes in each stack.  9,128 means 9 and 128, not nine thousand one hun-
  1439. dred twenty-eight.
  1440.                            <page down> for more
  1441.                              STACKS continued
  1442. So what is this "stacks" stuff anyway?  Well every time you hit a key on
  1443. the keyboard, that generates a hardware interrupt.  Every time a bit of
  1444. data comes across your modem, that generates an interrupt.  Each time the
  1445. floppy disk controller says, "Ok, I'm done writing that file you told me
  1446. to write", that's an interrupt.  The computer has to have a place to put
  1447. what it's working on, so that it can handle the interrupt and go back to
  1448. what it was doing before, and that place is what the stacks are.
  1449.  
  1450. In case a software program you're using doesn't have enough stack space
  1451. built into it, the computer will need for DOS to have some stack space
  1452. set up.  If a stack overflow occurs, generally that's going to lock up
  1453. the computer tighter than a drum, and the only thing you'll be able to
  1454. do is reboot.  The very next thing you'll want to do is edit your CON-
  1455. FIG.|nSYS|n file to allocate some more stack space, and then |nreboot|n again
  1456. to make the new CONFIG.SYS file take effect, so it won't happen again.
  1457. Because when your computer locks up when you're in the middle of a pro-
  1458. gram, you lose whatever changes you might have been making in the file
  1459. you were working on.
  1460.  
  1461.                            The |TTRUENAME|T Command
  1462.  
  1463. This is an undocumented command, which means two things.  First, it means
  1464. that it's not mentioned in the manuals.  Second, it means that Microsoft
  1465. is not promising to keep supporting this feature in later DOS versions.
  1466. They might leave it in, or they might not.
  1467.  
  1468. Well the command made its first appearance in DOS version 4, and its pur-
  1469. pose is, as its name implies, to tell you the actual name of a drive or
  1470. directory that is currently being disguised as some different drive or
  1471. |ndirectory|n, via the ASSIGN, JOIN, or SUBST commands.
  1472.  
  1473. For example, if you have used the |nSUBST|n command to pretend that the dir-
  1474. ectory D:\WORD\DOCS is the E: drive, then if you say |nTRUENAME|n E: it will
  1475. tell you D:\WORD\DOCS.  You can also use this command with no parameters,
  1476. and it will tell you the true name of the current drive and |ndirectory|n, or
  1477. with a drive and |spath|sname, or with a filename, or whatever.
  1478.  
  1479. Just remember that the fact that Microsoft didn't document this new com-
  1480. mand could mean that it doesn't always work right.
  1481.                             The |TVERIFY|T Command
  1482.  
  1483. This command, with no parameters, tells you whether DOS's write verifica-
  1484. tion flag is turned on or off.  |nVERIFY|n ON will turn it on, and |nVERIFY|n OFF
  1485. will turn it off.  Off is the default so if you want to leave it off, you
  1486. don't have to do anything with it.  About the only time you want to turn
  1487. |nVERIFY|n on is when you're making a backup, or when you think your disk is
  1488. going bad or something.  But remember to disable your disk cache, or else
  1489. |nVERIFY|n does no good, because DOS will be verifying the data in the |ncache|n,
  1490. and just think that it's the disk that it's verifying.
  1491.  
  1492. All it does is to verify that the copy of whatever was just written can
  1493. be read from the disk, meaning that it was not written to a bad sector.
  1494. It does not in any way compare the data that was written to the data that
  1495. was supposed to be written.  Other than that, it just makes everything
  1496. work a lot slower than normal.  The |nVERIFY|n command does the same thing as
  1497. the /V switch with the COPY or XCOPY commands, only |nVERIFY|n does it all
  1498. the time instead of just when you use the /V switch, if you have |nVERIFY|n
  1499. turned on.  It's just a lot more sensible to use COMP or FC instead of
  1500. |nVERIFY|n, to make sure any important files were properly copied.
  1501.                             What Are |tWildcards|t?
  1502.  
  1503. |nWildcards|n are a way to specify a group of files all in one word, so that
  1504. you can perform some DOS operation on them all by using just one command.
  1505. For example, you can't specify multiple files as parameters to the DEL
  1506. command, but what if you want to delete all the files in a |sdirectory|s?  Do
  1507. you have to delete every single filename separately?
  1508.  
  1509. No, you can use |nwildcards|n.  You know what |nwildcards|n do in poker, right?
  1510. If the dealer says at the beginning of a hand that the J is going to be
  1511. a wildcard, and you end up with the hand 10 J Q J A, then you can
  1512. say that your J is posing as a K, and you have a royal straight flush!
  1513. Well |nwildcards|n in DOS work in a similar manner.
  1514.  
  1515. The two |nwildcards|n that can be used are ? and *.  The ? stands for "any
  1516. character in this position" and the * stands for "any character from this
  1517. position through the end of the filename" if the * is in the filename,
  1518. or "any character from this position through the end of the extension" if
  1519. the * is in the extension.
  1520.                            <page down> for more
  1521.                             Wildcards continued
  1522. The wildcard specification |t*.*|t means every file with any number of char-
  1523. acters in the filename and any number (including zero) of characters in
  1524. the extension (up to the normal limit), in the current directory.  (See
  1525. the RENAME chapter for some important information about how |nwildcards|n are
  1526. used on the target half of a command!)  *.EXE would mean every file that
  1527. has the .EXE extension.  BL*.? means all files whose first name starts
  1528. with BL and whose extension is only zero or one character long.  BL??.E*
  1529. means all files whose first name starts with BL and only have zero, one,
  1530. or two characters after that, and whose extension starts with E.
  1531.  
  1532. The reason that ? and * can represent zero characters, is that in a dir-
  1533. ectory, the bytes of data are always located in the same place.  I mean,
  1534. the filename always starts in column one, the extension in column nine,
  1535. followed by the attributes byte in column twelve, etc.  So if a filename
  1536. is only five characters long, then columns six through eight are padded
  1537. with spaces.  Well as far as |nwildcards|n are concerned, a <Space> is sort
  1538. of a valid filename character, even though in other cases, DOS does not
  1539. allow them at all.
  1540.                            <page down> for more
  1541.                             Wildcards continued
  1542. That's why if you ever accidentally give a file a name that has a <Space>
  1543. in it, and DOS won't let you do anything with it, you can use a wildcard
  1544. specification to rename the file to some legal filename.  For example, if
  1545. the file was named ABC DEF.TXT, then you could do this:
  1546.           |nRENAME|n ABC?DEF.TXT ABC-DEF.TXT
  1547. because the ? will pick up the <Space> in the filename, and a hyphen (-)
  1548. is a valid filename character.  Now DOS will let you access that file.
  1549.  
  1550. Anyway, one thing you have to remember is that you don't have any control
  1551. over how many characters the * wildcard will stand for.  If you want to
  1552. refer to two files named ABCDE.TXT and ABCE.TXT, you know that AB?E.TXT
  1553. won't work because in that first file, there are two characters between
  1554. the B and the E, so you might try AB*E.TXT.  Well that wildcard spec will
  1555. pick up both of those files, but it will also pickup any other files that
  1556. start with AB and have the .TXT extension, regardless of whether the last
  1557. letter in the filename is an E or not, because * means "any characters
  1558. from here to the end of the filename", not just "one or two characters".
  1559. DOS will just totally ignore the E in that wildcard filespec.
  1560.                            <page down> for more
  1561.                             Wildcards continued
  1562. So, do you want to delete every file in the current |sdirectory|s?  |nDEL|n |n*.*|n
  1563. will do it.  Want to copy all the files in your word processing program
  1564. to a floppy in drive B:?  If they all start with WP, then |nCOPY|n WP*.* B:
  1565. will do that.  Most DOS commands use wildcard specifications in place of
  1566. exact filenames.  |nWildcards|n won't catch Hidden files, though.  The wild-
  1567. card specification of *.* will catch all the files in the |ncurrent|n dir-
  1568. ectory except for the ones with H or S attributes.
  1569.  
  1570. One thing that's really important when using |nwildcards|n, especially with
  1571. the DEL or ERASE commands:  always do a DIR of it first!  If you're about
  1572. to use |nDEL|n ABC*.?? to delete everything that has a filename that starts
  1573. with ABC and an extension of two or fewer characters, then first do |nDIR|n
  1574. ABC*.?? to make sure you aren't about to delete something you hadn't in-
  1575. tended to delete.  Then if the |nDIR|n command doesn't show you any surpris-
  1576. es, just type |nDEL|n and <F3> and <Enter>.  (See editing keys.)  Because the
  1577. |nDEL|n will overwrite the |nDIR|n in the template (DOS's |nmemory|n of the last com-
  1578. mand line) and then the <F3> key will copy the ABC*.?? from the template
  1579. to the |ncurrent|n command line.  That way you always know for sure, exactly
  1580. which files you are about to delete with a wildcard specification.
  1581.                             The |TREPLACE|T Command
  1582.  
  1583. This command is good especially for updating to a new version of a soft-
  1584. ware package.  With the /U switch, it will take all the files from the
  1585. source disk that have the same names, but later dates, than the files on
  1586. the target disk.  Then you can use it one more time with the /A switch
  1587. instead of the /U, to add all the files that are on the source disk that
  1588. don't exist on the target disk.  Pretty easy, huh?
  1589.  
  1590. Here's the complete syntax:
  1591.           |nREPLACE|n D:\DIR\FILENAME.EXT D:\DIR\ /A /P /R /S /U /W
  1592. where the first D:\DIR\ is where the source files are, and the second
  1593. D:\DIR\ is where you want the files to go.  Here are the switches:
  1594.  
  1595. The /A switch makes |nREPLACE|n add the files that exist on the source disk,
  1596. that do not exist on the target disk.  This is the switch you want to use
  1597. after you've already run the |nREPLACE|n command with the /U switch.  This is
  1598. also the switch you want to use if all you want to do is copy files that
  1599. do not exist already on the target disk.  Very handy!  But it only works
  1600.                            <page down> for more
  1601.                              REPLACE continued
  1602. in the specified target directory.  In other words, you can't use the /S
  1603. switch with the /A switch.
  1604.  
  1605. The /P switch makes |nREPLACE|n pause and ask for permission before each file
  1606. it copies.
  1607.  
  1608. The /R switch makes |nREPLACE|n update even the files that have their Read-
  1609. only attributes turned on.  Only it doesn't set the R attribute for the
  1610. file after it writes it, you have to do that yourself if you want to.
  1611.  
  1612. The /S switch causes |nREPLACE|n to search subdirectories of the specified
  1613. target |ndirectory|n, for files that need to be updated.  It doesn't search
  1614. subdirectories of the source |ndirectory|n, though, just the target.  Now you
  1615. want to be careful with this switch, because there might be a file in one
  1616. of the subdirectories, that has the same name as one of the files on the
  1617. source disk, but that has no relation to the program you're updating.  If
  1618. so, that file will be overwritten by the file on the source disk that has
  1619. the same name.  It's also useful if you have more than one copy of a cer-
  1620.                            <page down> for more
  1621.                              REPLACE continued
  1622. tain file on your disk, in different subdirectories, and you receive a
  1623. newer copy of that file.  If you're sure that all the files on the disk
  1624. that have that name, are the same file and you want them all replaced
  1625. with the new version, then use the root directory as the target and use
  1626. the /S switch.
  1627.  
  1628. The /U switch makes |nREPLACE|n work only with files that have a later date
  1629. and time on the source disk than the date on the target disk.  That means
  1630. you won't replace a newer file with an older file.  This switch did not
  1631. exist until DOS version 4, though.
  1632.  
  1633. The /W switch makes |nREPLACE|n stop for a second and let you change disks,
  1634. between the time you enter the command and the time it will start looking
  1635. for files to copy.  That's for if you have the |nREPLACE|n.EXE file on one
  1636. disk, and the source files on some other disk of the same size, you put
  1637. the disk that contains |nREPLACE|n.EXE into the drive, enter the command with
  1638. the /W switch, and it will let you take out the |nREPLACE|n.EXE disk and put
  1639. in the source disk instead, and then it will start copying.
  1640.                            <page down> for more
  1641.                              REPLACE continued
  1642. So what you usually want to do is run the |nREPLACE|n command once with the
  1643. /A switch and once with the /S and /U switches, for each directory on the
  1644. source disk that contains files you want to have updated.  If the source
  1645. files are all in just one |ndirectory|n, then you only need to use those two
  1646. commands one time each, to update the whole program.
  1647.  
  1648. You're probably wondering what use this command is, when you could just
  1649. use the XCOPY command to copy them all with just one command?  Well if
  1650. the target files are in different directories, like maybe C:\WORD and
  1651. C:\WORD\DOCS and C:\WORD\LTRS and C:\WORD\NOTES, and all the source files
  1652. are in one |ndirectory|n on the A: drive, for example, then a command like
  1653. |nXCOPY|n A:|n*.*|n C:\WORD would put all the files into the C:\WORD |ndirectory|n,
  1654. even if some of them belong in some of those subdirectories of the C:\
  1655. WORD |ndirectory|n.  The |nREPLACE|n command will look to see where you already
  1656. have each file, and put the later copy of each file into the right sub-
  1657. |ndirectory|n.  The only problem is, files that exist on the source disk that
  1658. didn't exist on the target disk, will all be put into the same |ndirectory|n
  1659. on the target disk, unless you fiddle with the /P switch a lot.
  1660.                            <page down> for more
  1661.                              REPLACE continued
  1662. Ok, that's not exactly the only problem.  The |nREPLACE|n command, like most
  1663. commands, will not copy Hidden files, nor those that have their System
  1664. attributes set.  But for programs that don't use any of those types of
  1665. files, and that don't have their own installation routines, this can be
  1666. a very helpful command.
  1667.  
  1668.  
  1669.  
  1670.  
  1671.  
  1672.  
  1673.  
  1674.  
  1675.  
  1676.  
  1677.  
  1678.  
  1679.  
  1680.  
  1681.                             The |TSELECT|T Command
  1682.  
  1683. In version 3 of DOS, this command has to do with code page switching.
  1684. (See COUNTRY.)  The DOS version 4 |nSELECT|n command is the installation pro-
  1685. gram which installs DOS 4 onto your hard drive, and since DOS 5 was re-
  1686. leased three weeks ago I'm sure no one is going to buy a new copy of the
  1687. old version 4, so I won't waste your time on this one.
  1688.  
  1689.  
  1690.  
  1691.  
  1692.  
  1693.  
  1694.  
  1695.  
  1696.  
  1697.  
  1698.  
  1699.  
  1700.  
  1701.                               The |TIF|T Command
  1702.  
  1703. This is a batch file command, which almost never has any use at the DOS
  1704. prompt.  It causes the following command to be executed or ignored, based
  1705. on whether or not the |nIF|n statement is true.
  1706.  
  1707. There are several types of |nIF|n statements, and each of them can be used
  1708. with a |TNOT|T qualifier.  Let's take each type separately.
  1709.  
  1710. First, there is IF |TEXIST|T.  This is used to check on whether or not a cer-
  1711. tain filename exists in the current or specified directory.  Suppose you
  1712. are in the C:\ |ndirectory|n and you do have a file named C:\|nCONFIG.SYS|n, then
  1713. the command |nIF|n |nEXIST|n |nCONFIG.SYS|n |nECHO|n YES, in a |nbatch file|n, would cause
  1714. the word YES to appear on your screen.  The command |nIF|n |nNOT|n |nEXIST|n CONFIG
  1715. .|nSYS|n |nECHO|n NO would cause nothing at all to happen, since CONFIG.SYS does
  1716. exist.
  1717.  
  1718. You can also use this method to determine whether a file exists in some
  1719. other |ndirectory|n, by saying |nIF|n |nEXIST|n C:\DOS\MODE.COM |nECHO|n YES.
  1720.                            <page down> for more
  1721.                                IF continued
  1722. It is also possible to determine whether a directory exists, even though
  1723. you can't say something like |nIF|n |nEXIST|n C:\DOS |nECHO|n YES because that would
  1724. cause DOS to look for a file named DOS in the root |ndirectory|n, rather than
  1725. looking for a |ndirectory|n named DOS.  Here's how it can be done:
  1726.           |nIF|n |nEXIST|n C:\DOS\NUL |nECHO|n YES
  1727. NUL is a sort of an imaginary device that DOS uses, and it does sort of
  1728. exist in every |ndirectory|n on your disk.  Of course you will not find it in
  1729. a |ndirectory|n listing, but it is sort of there as far as DOS is concerned,
  1730. so that |nIF|n test will report that the C:\DOS |ndirectory|n does exist, whether
  1731. or not there are any files in it.
  1732.  
  1733. Next, there is |nIF|n A==B.  This is used to check on whether A is equal to B
  1734. or not.  Notice that you always need to use two equals (=) signs together
  1735. and that you shouldn't leave any spaces in the comparison section of the
  1736. command.
  1737.  
  1738. The only time this is really useful is when either the A or the B is a
  1739. replaceable parameter or an environment variable.  (See the batch file
  1740.                            <page down> for more
  1741.                                IF continued
  1742. section for more information about using environment variables.)  Now you
  1743. also need to use some sort of a dummy character, in case the variable or
  1744. parameter was not supplied.  For example, if you had forgotten to set the
  1745. ONE variable before executing the following |sbatch file|s command:
  1746.           |nIF|n %ONE%==YES |nGOTO|n NEXT
  1747. then DOS would expand that line to say |nIF|n ==YES |nGOTO|n NEXT because if ONE
  1748. was not set, then it is equal to nothing.  This line will give you a
  1749. major syntax error.  But if you had instead said:
  1750.           |nIF|n !%ONE%==!YES |nGOTO|n NEXT
  1751. and you still forgot to |nSET|n ONE=YES before running the |nbatch file|n, then
  1752. DOS would expand that line to say |nIF|n !==!YES |nGOTO|n NEXT.  Well that may
  1753. not have been the result you had intended, but at least it is not an
  1754. error message.  You can use just about any character you want for the
  1755. dummy character, not just the exclamation point that I used in that
  1756. example.  As long as you put the same character on each side of the ==
  1757. signs, it will work.
  1758.  
  1759. Another use for the dummy character is with replaceable parameters.  To
  1760.                            <page down> for more
  1761.                                IF continued
  1762. make sure that the user of the batch file remembers to type a parameter
  1763. on the command line, you could do this:
  1764.           |nIF|n !%1==! |nGOTO|n FORGOT
  1765. Because if there was no parameter on the command line, then DOS will
  1766. expand that line to say |nIF|n !==! |nGOTO|n FORGOT, and ! does indeed equal !.
  1767. Then under the :FORGOT label, you might want to use some ECHO statements
  1768. to tell the user how the |nbatch file|n should have been run.  (See the GOTO
  1769. section for an example.)
  1770.  
  1771. Then there is IF |TERRORLEVEL|T.  A lot of programs return an |nERRORLEVEL|n to
  1772. DOS after they complete whatever function they were supposed to perform,
  1773. and that |nERRORLEVEL|n can be used in a |nbatch file|n.  For example, the DISK-
  1774. |nCOPY|n command returns an |nERRORLEVEL|n of 1, 2, 3, or 4, if the command was
  1775. not successful, or an |nERRORLEVEL|n of 0 if it was.  Well the |nIF|n |nERRORLEVEL|n
  1776. test is positive if the |nERRORLEVEL|n is the same or higher as the one spec-
  1777. ified, so a |nbatch file|n like:
  1778.  
  1779.  
  1780.                            <page down> for more
  1781.                                IF continued
  1782.           |nDISKCOPY|n A: A:
  1783.           |nIF|n |nNOT|n |nERRORLEVEL|n 1 |nGOTO|n OK
  1784.           |nECHO|n Something went wrong!
  1785.           |nGOTO|n END
  1786.           :OK
  1787.           |nECHO|n It worked!
  1788.           :END
  1789. will always report "Something went wrong!" if |sDISKCOPY|s's ERRORLEVEL is 1
  1790. or higher, or "It worked!" if the |nERRORLEVEL|n is less than 1.
  1791.  
  1792. There are quite a few little public domain utilities that can be used in
  1793. a batch file to perform some action based on keyboard input.  For exam-
  1794. ple, a little program from the 2/90 issue of PC/Computing magazine called
  1795. ASK.COM (watch out because I've seen other versions of commands named ASK
  1796. .COM that didn't work quite the same way), is used like this to retrieve
  1797. a Yes or No from the user during execution of a |nbatch file|n:
  1798.  
  1799.  
  1800.                            <page down> for more
  1801.                                IF continued
  1802.           @ECHO OFF
  1803.           |nECHO|n Do you want to load your screen saver into memory?  (Y/n)
  1804.           ASK
  1805.           |nIF|n |nERRORLEVEL|n 1 |nGOTO|n YES
  1806.           |nGOTO|n NO
  1807.           :YES
  1808.           (Command here to load screen saver)
  1809.           |nGOTO|n END
  1810.           :NO
  1811.           (Command here for if screen saver is not loaded)
  1812.           :END
  1813. The ASK.COM program looks to the keyboard to see which key you press.  If
  1814. it is Y or y, an ERRORLEVEL of 2 is returned.  If it is <Enter>, the
  1815. |nERRORLEVEL|n is 1.  If you press N or n, the |nERRORLEVEL|n is 0.  So in the
  1816. sample batch file above, if you press Y, y, or <Enter>, an |nERRORLEVEL|n of
  1817. 1 or higher will be returned, so the |nGOTO|n YES command will be executed.
  1818. If you press N or n, the |nERRORLEVEL|n will be 0 which is less than 1, so
  1819. the |nGOTO|n YES command will be ignored and the next line, |nGOTO|n NO will be
  1820.                            <page down> for more
  1821.                                IF continued
  1822. executed instead.
  1823.  
  1824. What if the question were instead in reference to something to which the
  1825. answer will more often be No rather than Yes?  You would want the default
  1826. chosen by the <Enter> key to be No instead.  You could do that like this:
  1827.           @ECHO OFF
  1828.           |nECHO|n Do you want to run CHKDSK?  (y/N)
  1829.           ASK
  1830.           |nIF|n |nERRORLEVEL|n 2 |nGOTO|n YES
  1831.           |nGOTO|n NO
  1832. This time, since the |nIF|n |nERRORLEVEL|n command specifies 2, the |nGOTO|n YES com-
  1833. mand will only be executed if the Y or y keys are pressed.  Anything else
  1834. like N, n, or <Enter>, will return an ERRORLEVEL of 1 or 0 which is lower
  1835. than 2, so the |nGOTO|n YES command will be ignored and the |nGOTO|n NO command
  1836. will be executed instead.
  1837.  
  1838. You could also use the ASK.COM program for a purpose that required three
  1839. separate options.  Like this:
  1840.                            <page down> for more
  1841.                                IF continued
  1842.           @ECHO OFF
  1843.           |nECHO|n If you want choice A, press Y or y.
  1844.           |nECHO|n If you want choice B, press [Enter].
  1845.           |nECHO|n If you want choice C, press N or n.
  1846.           ASK
  1847.           |nIF|n |nERRORLEVEL|n 2 |nGOTO|n YES
  1848.           |nIF|n |nERRORLEVEL|n 1 |nGOTO|n ENTER
  1849.           |nGOTO|n NO
  1850. Now don't forget to put those ERRORLEVEL statements in the correct order!
  1851. Since an |nIF|n |nERRORLEVEL|n statement is true if the |nERRORLEVEL|n is the same or
  1852. higher than the one specified, then if you did it like this:
  1853.           |nIF|n |nERRORLEVEL|n 1 |nGOTO|n ENTER
  1854.           |nIF|n |nERRORLEVEL|n 2 |nGOTO|n YES
  1855. then any time the |nERRORLEVEL|n is 1 or 2, the |nGOTO|n ENTER command will be
  1856. executed, and so DOS will never see the |nIF|n |nERRORLEVEL|n 2 command.
  1857.  
  1858. Notice that in that batch file, I couldn't use the <Enter> symbol to rep-
  1859. resent that key, as I usually do, because DOS interprets the < and > sym-
  1860.                            <page down> for more
  1861.                                IF continued
  1862. bols as representing I/O redirection.
  1863.  
  1864. Now remember that ASK.COM is not a part of DOS, so you can't use any of
  1865. those batch files unless you get that utility.  But since DOS did such a
  1866. lousy job of making use of its own ERRORLEVEL parameter, I had to use
  1867. that third-party utility as an example of what |nERRORLEVEL|n could do.
  1868.  
  1869. You can even nest one |nIF|n command inside another, as in:
  1870.           |nIF|n |nERRORLEVEL|n 2 |nIF|n |nNOT|n |nERRORLEVEL|n 3 |nGOTO|n TWO
  1871. Now if the |nERRORLEVEL|n were 1, then the first |nIF|n test would fail, so the
  1872. second one would not even be noticed by DOS.  But if the |nERRORLEVEL|n were
  1873. 2, then the first |nIF|n test would pass, and then the second test would also
  1874. pass since it includes the NOT qualifier, so the GOTO command would be
  1875. executed.  And if the |nERRORLEVEL|n were 3 then the first |nIF|n test would pass
  1876. but the second one would fail, so the |nGOTO|n command would be ignored.
  1877.  
  1878.  
  1879.  
  1880.  
  1881.                          PLEASE IGNORE THIS PAGE!
  1882. |TSET|T|fSIMPLY1|f
  1883. |TSHELL|T|fSIMPLY1|f
  1884. |t286|t|fSIMPLY1|f
  1885. |t8088|t|fSIMPLY1|f
  1886. |tANSI.SYS|t|fSIMPLY1|f
  1887. |tAUTOEXEC.BAT|t|fSIMPLY1|f
  1888. |tAttributes|t|fSIMPLY1|f
  1889. |tBACKUP|t|fSIMPLY1|f
  1890. |tCHDIR|t|fSIMPLY1|f
  1891. |tCHKDSK|t|fSIMPLY1|f
  1892. |tCOMSPEC|t|fSIMPLY1|f
  1893. |tCPU|t|fSIMPLY1|f
  1894. |tCache|t|fSIMPLY1|f
  1895. |tDISKCOPY|t|fSIMPLY1|f
  1896. |tDirectory|t|fSIMPLY1|f
  1897. |tEMS|t|fSIMPLY1|f
  1898. |tEnvironment|t|fSIMPLY1|f
  1899. |tExpanded|t|fSIMPLY1|f
  1900. |tExtended|t|fSIMPLY1|f
  1901. |tHIMEM.SYS|t|fSIMPLY1|f
  1902. |tHidden files|t|fSIMPLY1|f
  1903. |tIBMBIO.COM|t|fSIMPLY1|f
  1904. |tIBMDOS.COM|t|fSIMPLY1|f
  1905. |tIO.SYS|t|fSIMPLY1|f
  1906. |tLIM|t|fSIMPLY1|f
  1907. |tMSDOS.SYS|t|fSIMPLY1|f
  1908. |tMemory|t|fSIMPLY1|f
  1909. |tRAM|t|fSIMPLY1|f
  1910. |tRMDIR|t|fSIMPLY1|f
  1911. |tROM|t|fSIMPLY1|f
  1912. |tXMS|t|fSIMPLY1|f
  1913. |tbytes|t|fSIMPLY1|f
  1914. |tcurrent|t|fSIMPLY1|f
  1915. |tdefault|t|fSIMPLY1|f
  1916. |tfragmented|t|fSIMPLY1|f
  1917. |tmultitasker|t|fSIMPLY1|f
  1918. |tpublic domain|t|fSIMPLY1|f
  1919. |troot|t|fSIMPLY1|f
  1920. |tupper|t|fSIMPLY1|f
  1921. |TEXIT|T|fSIMPLY2|f
  1922. |TFORMAT|T|fSIMPLY2|f
  1923. |TRESTORE|T|fSIMPLY2|f
  1924. |TSYS|T|fSIMPLY2|f
  1925. |tASCII|t|fSIMPLY2|f
  1926. |tBoo|1t Disk|t|fSIMPLY2|f
  1927. |tDisks|t|fSIMPLY2|f
  1928. |tEDLIN|t|fSIMPLY2|f
  1929. |tExecutable|t|fSIMPLY2|f
  1930. |tParameters|t|fSIMPLY2|f
  1931. |tPower|t|fSIMPLY2|f
  1932. |tRAMdisk|t|fSIMPLY2|f
  1933. |tShelling Out|t|fSIMPLY2|f
  1934. |tediting keys|t|fSIMPLY2|f
  1935. |tfloppy|t|fSIMPLY2|f
  1936. |TAPPEND|T|fSIMPLY3|f
  1937. |TASSIGN|T|fSIMPLY3|f
  1938. |TBREAK|T|fSIMPLY3|f
  1939. |TBUFFERS|T|fSIMPLY3|f
  1940. |TCALL|T|fSIMPLY3|f
  1941. |TCHCP|T|fSIMPLY3|f
  1942. |TCLS|T|fSIMPLY3|f
  1943. |TCOM1|T|fSIMPLY3|f
  1944. |TCOMP|T|fSIMPLY3|f
  1945. |TCOPY|T|fSIMPLY3|f
  1946. |TCOUNTRY|T|fSIMPLY3|f
  1947. |TCTTY|T|fSIMPLY3|f
  1948. |TDATE|T|fSIMPLY3|f
  1949. |TDEL|T|fSIMPLY3|f
  1950. |TDEVICEHIGH|T|fSIMPLY3|f
  1951. |TDEVIC|1E|T|fSIMPLY3|f
  1952. |TDIR|T|fSIMPLY3|f
  1953. |TDISKCOMP|T|fSIMPLY3|f
  1954. |TDO|1S|T|fSIMPLY3|f
  1955. |TERASE|T|fSIMPLY3|f
  1956. |TFOR|T|fSIMPLY3|f
  1957. |TLPT1|T|fSIMPLY3|f
  1958. |TSHIFT|T|fSIMPLY3|f
  1959. |TTIME|T|fSIMPLY3|f
  1960. |tBad command or filename|t|fSIMPLY3|f
  1961. |tPATH|t|fSIMPLY3|f
  1962. |TDOSKEY|T|fSIMPLY4|f
  1963. |TDRIVPARM|T|fSIMPLY4|f
  1964. |TECHO|T|fSIMPLY4|f
  1965. |TEDIT|T|fSIMPLY4|f
  1966. |TFASTOPEN|T|fSIMPLY4|f
  1967. |TFCBS|T|fSIMPLY4|f
  1968. |TFC|T|fSIMPLY4|f
  1969. |TFDISK|T|fSIMPLY4|f
  1970. |TFILES|T|fSIMPLY4|f
  1971. |TGOTO|T|fSIMPLY4|f
  1972. |TINSTALL|T|fSIMPLY4|f
  1973. |TLABEL|T|fSIMPLY4|f
  1974. |TLASTDRIVE|T|fSIMPLY4|f
  1975. |TLOADHIGH|T|fSIMPLY4|f
  1976. |TMKDIR|T|fSIMPLY4|f
  1977. |TPRINT|T|fSIMPLY6|f
  1978. |TQBASIC|T|fSIMPLY6|f
  1979. |TSUBST|T|fSIMPLY6|f
  1980. |TSWITCHAR|T|fSIMPLY6|f
  1981. |TSWITCHES|T|fSIMPLY6|f
  1982. |TTYPE|T|fSIMPLY6|f
  1983. |tCONFIG.SYS|t|fSIMPLY6|f
  1984. |tFAT|t|fSIMPLY6|f
  1985. |tKeyboard|t|fSIMPLY6|f
  1986. |tLogical Drives|t|fSIMPLY6|f
  1987. |tRedirection|t|fSIMPLY6|f
  1988. |tTSR|t|fSIMPLY6|f
  1989. |TXCOPY|T|fSIMPLY2|f
  1990. |tBatch File|t|fSIMPLY7|f
  1991. |tDevice Driver|t|fSIMPLY3|f
  1992. |tPROMPT|t|fSIMPLY6|f
  1993. |TNUL|T|fSIMPLY3|f
  1994. |tReplaceable|t|fSIMPLY2|f
  1995.